{ by david linsin }

Showing posts with label twitter. Show all posts
Showing posts with label twitter. Show all posts

November 06, 2010

Word Buzz getting a better Twitter integration!

114x114.pngIf you follow our tweets, which you should, you might have seen that we have been working hard on a better Twitter integration for Word Buzz. When looking around on github, I found a lot of frameworks for Twitter and iOS, but only Stefan's was lightweight and easy enough to integrate it into Word Buzz.

Most of the frameworks are full blown Twitter engines, which is not what we need for Word Buzz. Our requirements are simple: share your achievements (maybe your highscore in the future) with your followers. In addition to that, Twitter is our support channel. We wanted to allow posting public messages to @WordBuzzApp from within the App. Sounds easy, right? No need to pull in a full fledged Twitter engine for that!iphone-twitter.png

Stefan's provides an API, which is really easy to use and integrate. There are no 3rd party dependencies, no need to fiddle with your linker flags - just an API to use! It even comes with a reasonable UI in Twitter style colors. Unfortunately, there was no iPad UI, which we had to implement myself. However, it was easy enough to come up with a Xib for iPad. Stefan's API provides delegate protocols, which you can implement to handle events such as "authentication succeeded". This way it's easy to separate the Twitter logic from your own code. The UIViewControllers provided, handle the most basic tasks like checking if you entered enough information to process with authentication.

We are using xAuth for authentication, which Twitter has to enable for your App. It took a couple of days until they came around to let us in, but it was the best solutions. Stefan's API provides xAuth out of the box and it works seamlessly. We added a Keychain integration to save your credentials and a flag in Settings.app to reset them.

Overall, it took us about 1 days to natively integrate Twitter into Word Buzz - thanks to Stefan's API! If anybody is interested, we are happy to provide the iPad UI and the Keychain integration.

August 08, 2007

Fixed at Error twitters

Today I fixed my "at Error" twitters, since they even were annoying myself. I'm looking forward to work with the pownce API soon, since the guys already have some stuff going on.

At the moment I'm using plazer to update my twitter and plazes status, but I'm looking for an alternative. I wanna be able to update it using a desktop client, a web client and from my mobile phone.

June 17, 2007

Twittering with Plazes Fix

My Plazes status seems to be updated multiple times on Twitter, that's why I decided to tweak Paul's script a little and check if my status changed, before actually updating Twitter. This should prevent multiple updates on Twitter.

If you are interested here's the source code.

June 14, 2007

Twittering with Plazes

This is another installment of integrating Twitter and Plazes. I finally managed to post twitters using my Plazes rss feed.

I found this little neat php script, written by Paul. I adopted it to suit my needs and let it run by a cron job on my server. It basically grabs my Plazes feed and pushs it to Twitter. It's quite simple.

I'm still tweaking on the frequency of publishing to Twitter, I guess every 20 minutes or so should be okay.

June 12, 2007

Yahoo pipes for integration

On my quest for integrating Twitter and Plazes with my blog, I'm using Yahoo pipes now. Yahoo describes pipes as follows:

Pipes is an interactive data aggregator and manipulator that lets you mashup your favorite online data sources.

I'm using pipes to manipulate the Plazes rss feed, which contains my location and my status, to create the little sentence you can see in my presence box. Therefore I leverage JSON to access the pipe data. It works very well and I don't have any delays, unlike using Google's AJAX Feed API. Another advantages is that I didn't have to code JavaScript. The pipe's editor was fairly easy to use and I had my pipe up and running in less than an hour.

June 11, 2007

Google AJAX Feed API delays

When I tried to integrate the new plazes rss feed with blogger, my first approach was to used Google's AJAX Feed API. It's straightforward and you don't need to code a lot in order to read and use feed data.

The major problem of the Google's API, though, is a delay in updates. The feed you consume through the API will be fetched by Google's "Feedfetcher" infrequently, which means you'll get cached data if it hasn't been fetched for a while. The documentation states that the frequency of fetching feeds is "less than once every hour". My experience was, that it fetches feeds about every 6 hours. That's way to slow for a Twitter like behaviour.

The Google AJAX Feed API is also used for Google Reader, which is also kinda slow in updating feeds.

June 09, 2007

Rss to Twitter

I like Twitter a lot, but it's on and off is really annoying. So I decided to use Plazes instead and update my status there. Since I don't wanna get rid of Twitter at all, I'm looking for a way to publish my Plazes status through it's rss feed on Twitter.

There are two sites which are providing such a service and unfortunately both of them are not working! I don't know if it's Twitter itself or the rss to Twitter sites though.

The first site I used was rss2twitter. It didn't work at all. Over a period of 18 hours it had not updated my status once. Then I switched to twitterfeed, which only have published one update in about 24 hours.

Revamped Plazes

The new Plazes had been released while I was on holidays, so it was time to check it out. My conclusion: I love it! It still got some bugs e.g. the new Plazer freezes from time to time, but I guess they are working on it. A major drawback for me is that they haven't updated their APIs yet.

I really like the group feature cause it brings some kind of social networking thinggy to Plazes. Another cool thing is the twitter-like status that you can set by Plazer, web or SMS. I really hope the Plazes guys give some thought to their APIs, so that all data will be easily accessible.

At the moment I'm working on integrating the new Plazes with Twitter and my presence box.

May 07, 2007

Jitter

Two weeks ago, on The Java Posse podcast, they mentioned Jitter. It's a Java ME Twitter client, which lets you do pretty much everything on your mobile phone, that you can do through twitter.com.

I've been using it for a while now and I must say it works really well! No problems whatsoever! Go and check it out, it's worth a look

April 04, 2007

Twitter Google Group

There is a fairly active Google Group discussing Twitter development and the Twitter API. For instance they announced the deprecation of the property relative_created_at in their API there. I had to learn it the hard way.

March 30, 2007

Twitter API broken?

On my presence box on the right you used to see the time when I last twittered. Unfortunately the API seems to be broken, since the property relative_created_at of the callback object is undefined. I noticed that a couple of days ago and thought it's a temporary problem, but I guess it is not. I hope they'll fix it any time soon.

March 20, 2007

Twitterities

My Twitter integration has a couple of bugs that I'm gonna fix soon. For instance if twitter is down, like right now, my presence box shows "Twitter reported
that I'm and according to plazes I'm doing that in Karlsruhe at dave's". That only makes sense to people from Mars, so I'll need to fix it for the people from planet earth.

Another problem is Twitter's lags and unresponsiveness. If the site is really slow, so is my blog, since it's waiting for the presence box to report my Twitter status. I'm still thinking of how to implement some kind of time-out handling.

Third and (hopefully) last thing is the reply syntax of Twitter. You can reply to someone's Twitter by adding "@username:" in front of your Twitter. So today I replied to a Twitter of Dominik and my presence box showed something like "Twitter reported
that I'm @dominik: it ain't easy and according to plazes I'm doing that in Karlsruhe at dave's". Yupp, that's another for our fellows from Mars.

March 18, 2007

Searching Twitter

I just found this neat tool called twittersearch through Data Mining. It lets you search twitters by keywords and shows results ordered by time.

March 17, 2007

Integrating Twitter and plazes

Today I integrated Twitter and plazes into my blog, you can see it on the "presence" box at the sidebar. Integrating Twitter is pretty straightforward, since they are providing a javascript snippet that you can simply drop into your html code.


<script type="text/javascript">
function twitterCallback(obj) {
var id = obj[0].user.id;
document.getElementById('my_twitter_status').innerHTML = obj[0].text;
document.getElementById('my_twitter_status_time').innerHTML = obj[0].relative_created_at;
}
</script>
<span id="my_twitter_status"></span> <span id="my_twitter_status_time"></span>

<script type="text/javascript" src="http://www.twitter.com/t/status/user_timeline/
917241?callback=twitterCallback&count=1"></script>


Integrating plazes is not so simple though, at least if you want to do it text-based, without any flash widget. They provide an API, which you can only use after you registered a developer key, which I did. Unfortunately the developer key is not working, so I'm still waiting for support to get back to me. In the mean time I adopted a wordpress-plugin that was written by Tijs Teulings. The plazes API is based on XMLRPC. I think that makes integration via javascript quite messy, so I decided to use a php indirection which handles all the XMLRPC stuff for me.

include("xmlrpc.inc");
$location = askPlazes($plazes_username, $plazes_password_hash);

if ($location['plazecity'] == "o" || $location['plazecity'] == "o" || $location['plazename'] == "o") {
echo $_GET['callback'] . "(null);";
} else {
echo $_GET['callback'] . "({ \"plazes\": { \"city\": \"" . $location['plazecity'] . "\", \"name\": \"". $location['plazename'] . "\", \"url\": \"". $location['plazeurl'] . "\" } });";
}

function askPlazes($username, $passwordMD5) {
$c=new xmlrpc_client("/xmlrpc/whereami.php", "beta.plazes.com", 80);
$params = array(new xmlrpcval($username, "string"), new xmlrpcval($passwordMD5, "string"));
$f = new xmlrpcmsg('plazes.whereami', $params);
$r = $c->send($f);
$v = $r->value();

if ($r->faultCode()) {
echo "Plazes XML-RPC Fault: ";
echo "Code: " . $r->faultCode() . " Reason '" .$r->faultString()."'";
exit;
} else {
$PlazesData = php_xmlrpc_decode($v);
return $PlazesData;
}
}

It uses a xmlrpc library to make a call to a deprecated plazes API called "whereami". The call basically returns your current plaze with all necessary information. For javascript integration the php script prints a function call, which is provided as parameter when calling the script. To integrate this into my blog, I simply had to drop in a javascript snippet which includes the call to the php script and an implemention of the callback method.

function plazes(obj) {
if (obj != null) {
document.getElementById('my_plazes_city').innerHTML = 'doing that in ' + obj.plazes.city;

document.getElementById('my_plazes_name').innerHTML = ' at ' + obj.plazes.name + '';
} else {
document.getElementById('my_plazes_city').innerHTML = 'offline';
}
}

<script src="http://area51.linsin.de/plazes.php?callback=plazes" type="text/javascript"></script>

I've already implemented the php script to call the current plazes API, but as mentioned before I'm still waiting for response of the support.

March 14, 2007

Twitter API

I checked out the Twitter API today and I think it really sucks that it's fairly limited. What I was basically trying to do is use my mobile phone to update my status, without sending an SMS. The API of Twitter only allows you to use HTTP POST to update your status. So I created a sample site at http://area51.linsin.de/twitter.html which uses an html form to post a new status.

It works with Firefox using my computer and it even works using the limited WAP browser of my Nokia 6230i, but it doesn't work with Opera Mini. The Twitter API uses http basic authentication and unfortunately the twitter site is quite slow. Opera Mini seems to have a very short timeout or problems handling http basic authentication, since I can't get it to post my status.

If I have time I might write a little Java ME application which allows me to update my status using the phone's gprs connection. I have found a site called Yapmo.com, which has the mission to let us all "twitter better", but it's still in its infancy.

com_channels

  • mail(dlinsin@gmail.com)
  • jabber(dlinsin@gmail.com)
  • skype(dlinsin)

recent_postings

loading...