Dabr blog

 
« Back to blog

Dabr – Reply to all and Geotagging – via @edent

People have been very excited to see some new functionality in Dabr – the mobile Twitter client I develop for. But what is it and how does it work?

@@ and geotag

@@ and geotag

Reply to All

The @@ symbol allows you to reply to all the people mentioned within the tweet.
It only shows up on tweets which mention other users – so you should only ever see it when it can be used.

Hitting @@ on the above tweet will pre-populate the text box with “@topgold @whatleydude @dabr”.

It should remove any duplicates and should also remove your username.

Geotagging

Twitter recently allowed the geotagging of tweets. This allows you to set the longitude and latitude of where you are when you wrote your message.
Clicking on the green globe (it just looks like a dot at that size!) takes you to a mobile mapping service.

Google Maps Mobile

Google Maps Mobile

It only shows up on tweets which are geotagged – so you should only ever see it when it can be used.

How Does It Work?

You can see all the code in the SVN, but here’s a quick rundown.

Geotagging is very simple.  Statuses now have a <geo> field.  If this is populated, it will contain a longitude and latitude.

We can take those values and pass them to Google Maps Mobile (or your favourite mobile mapping service).
if ($geo !== null)
{
   $latlong = $geo->coordinates;
   $lat = $latlong[0];
   $long = $latlong[1];
   $actions[] = theme('action_icon', "http://maps.google.co.uk/m?q={$lat},{$long}", 'images/map.png', 'MAP');
}

Reply to all is a little more involved.
Twitter provide an excellent set of Text Libraries. These provide officially sanctioned regular expressions to help your project find URLs, hashtags and usernames.

Using the Twitter Text Extractor class we can determine how many usernames are mentioned in a tweet. Any duplicates are removed – as is the user’s username.

Any questions – just ask!

 

 

This update comes from one of @Dabr's more prolific coders, Sir Terence of Eden - aka @edent..

Terence runs his own version of Dabr using the open-source code and has been playing and updating now for some time. With permission, David went through the main service and applied the awesome changes you can see above...

What do you think?
Do you - like @topgold - like these new features?

Cheers,
James

Posted by James Whatley 

Comments (5)

Mar 24, 2010
hedgewytch liked this post.
Mar 24, 2010
My thoughts, now that it's added, are wondering whether reply-to-all should be the default action or not.
Mar 24, 2010
Dan M said...
Good stuff... Most looking forward to being able to geo a tweet and also see Lists improved
Mar 24, 2010
Reinaldo Diaz said...
Hey, i saw the Reply All function and i used it, it's very usefull, congrats to the Dabr's Team... Hey, i wanna know how to use the geotaggin from my cellphone...
Greetings
Mar 24, 2010
Rafael said...
Great! :)

Leave a comment...