Archive for the 'API' Category

How I created a TwitterGroup for Gnomedex

twitbot.gifI see Dave has posted a few ideas that he’d like to be able to do with Twitter. His ‘use case #1’ is regarding the ability to subscribe to a kind of ‘reading list’ of people at a conference. Good idea! TwitterGroups are what we need! 🙂

So, while I was at Gnomedex, I wanted a way to track tweets (that’s Twitter posts, for the uninitiated ;p ) from others at the conference who were also on Twitter. A show of hands from the audience showed there were a LOT of us 😉 Naturally, I don’t want to have to follow every user and see everypost/tweet from them – I just want the ones relevant to the conference.

Having got the idea of how to do it in my head in the first morning session, I hacked it together quite quickly during the lunchbreak. It’s based very much like my Urban Dictionary ‘TwitterBot’ which will go and search for the (urban) meaning of a word, at the command of any follower.

So, here’s how I did it:
1. First, I set up an account, called @gnomenet

2. Then I set up a simple database table in MySql with a ‘status_id’ column and a ‘screen_name’ column.

3. I then invited people to ‘follow’ that account and instructed the followers to start a post with  ‘gd’ if they wanted their tweet to appear in the ‘group’ timeline – if they had something to say about the conference.

4. Then, I had a PHP script set on an automated cronjob to poll the followers.xml for the gnomenet account.  The followers.xml file always has the latest tweet from each follower, also providing the status(tweet) id and the follower’s screen name. It polled the followers.xml file once a minute, which is under Twitter’s API limit of 70 per hour.

5. When the script sees ‘gd’ at the start of a follower’s tweet, it then adds the screen_name and status_id to the database table. Then it sends that Tweet to the @gnomenet account after removing ‘gd ‘ from the start. This is easily done using Twitter’s very simple API.

6. The next time the script polls the followers.xml file, if it sees the same user posting the same thing (it compares each status_id with existing records in the database) it says to itself “this user already said that!” and ignores it.

7. If the follower does not have gd at the start of the Tweet, then the script goes and deletes from the database table any post from that user/screen_name  – ie: mostly, there is nothing to delete, as people don’t post to it all the time.

Doing this keeps the database table clean and compact. It worked pretty well for 52 followers! I wonder how many them were not even there at the conference! 🙂

This has a load of potential uses for TwitterBot automation and TwitterGroup creation, though I’m sure there might be a more graceful way of doing this. Happy to hear more ideas

Gnomedex was GREAT fun again – this was my third. But I have to say, I’m looking forward to the possibility of ‘GnomeStock‘ ;p

OS Twitter and Services

twitbot.gifIn light of Dave Winer’s recent post about Twitter since the announcement on TechCrunch that some new API features are on the way, I thought I’d point back to a couple of earlier posts I made about these very subjects. Ie: Using Twitter as a ‘service layer’ and Open Sourcing the Twitter server (without SMS) – that post also talks about the’@dictionary word‘ TwitterBot which I created after having the idea as a proof of concept.

I think it’s great and all that people like Nik, Steve and Dave are looking at this too. Let them pick up the ball and run with it. (Ermm. Did I drop it? Ah I see, there’s more than one! Heh)

The new Twitter stuff will enable developers to write ‘GroupWare’ too by delivering messages privately. I hope that Obvious add ‘groups’ soon though. Also the ability to distinguish/register an account as a ‘bot’ as opposed to a human.

BTW : Bots should not have ‘friends’ – only followers. That’s how a ‘client/user’ can register with the bot/service more easily. Simply add the user account.

I also use Twitter for server alerts too, letting me know when somthing has completed or gone wrong – this will help ‘privatize’ them without needing an ‘alt’ account.

I started out by asking my followers where I could find a decent search engine that can respond to a ‘human question’ – after not finding a good enough one with a decent API, I plumped for the Urban Dictionary, which can provide very amusing results ;)

One of the unique things about Twitter is the difference in push/pull with info than we are used to. Usually we ‘push’ a post, then ‘pull’ the website or feeds. Here, we have also have Twitter not only ‘pushing’ email, but also SMS – for ‘free’.

That’s so incredibly useful. ESPECIALLY given all the places in the world where mobile phones work, but the internet does not. Third World etc. This should be exciting to people working in remote situations.

Open Sourcing the Twitter server without the SMS capabilities would make the central Twitter.com/Obvious server like the ‘Sun’ where all the other OS Twitter servers would connect like ‘Planets’ – Obvious could then handle and monetize all the SMS transactions (which the OS server might lack) by charging for this feature.

Tweet! Tweet! Kerrchingg!! 🙂

Oh and I’ve been building a new forum-like content/communications system with RSS and OPML at the heart of it. Imagine ‘structured Tweets’ – with the ability to also attach files – as a payload – can you imagine how easy it is to flow, connect and direct all these via RSS and OPML? Wow!

More Twittering…

I see that Scripting News has been thinking of Twitter. I’m surprised at the reaction from someone who usually see so much potential in simple things.

UPDATE : More discussion from Dave Winer

At first, I thought – “so what’s so great about this Twitter thing?” – it’s just blogging with just titles. One-liners. With contact lists. Aggregation of those contacts’ one-liners. And an SMS communication layer to distribute those short messages away from the desktop…without the internet.

oh, hang on.. 🙂 — hmm…aha!

To me, it’s the SMS layer to mobiles which makes this interesting. It’s very easy to duplicate – but not so easy to pay for. But SMS ‘can’ make a lot of money (but for who, eh? *nudge*)

The actual content back end must be very simple indeed – but no idea about what they are doing with scaling that, but it seems to get better and worse now again, which means they are constantly tweaking it I imagine.

They say they will be adding groups. This is a good idea, as it will extend what users can do privately – and that means it could be used for businesses.

Also, through the very simple API it’s easy to build stuff on top of the comms framework they have there. Some useful. Some for fun.

Some sites have started to ‘ping’ their TwitterBots (which have no friends – as they don’t read – but many followers) with the latest updates to their systems – Techmeme, BBC, CNN, Podcast.com, etc. – It’s a little river of news, mashed up with commentary, streams of consciousness – and the mundane. I have a little function on my server, using PHP and Curl to ‘Tweet’ me from a special account when something goes wrong.

I’m toying with couple of usernames which I am ‘Sqwitting‘ (That’s username squatting on Twitter, folks) which I plan to make respond to certain calls and queries after any user who the ‘befriended’ the account calls using @question or @answer – which has now become the de facto way to openly reply to another one of your friends. It’s easy to list recent posts from friends with the API, so why not get it to ‘look’ for @name calls? *Bingo!* It’s like a machine!

There are heaps of combinations of feeds – in different formats – to play with and construct all sorts of useful things – all with that very handy SMS layer 🙂 It won’t be long before someone builds something very useful based on this system. But only when it’s reliable and faster! 🙂

Rex Hammock quotes a great line from Joi Ito on how Americans, when looking at new technology immediately ask, “What’s the business application?” In Japan, however, new technology is handed to children who are told, “Go play with it.” The kids play and do stuff that later becomes things that others realize would make sense also in a business context.

Great stuff!

Bloghud is Twitter on Acid in a Virtual World 🙂 Think what will happen to Twitter when we can easily add our Geo location latitude and longitude! (Still waiting for my Nokia N95 😉 )

In addition

(and I think this is important)

I think that they should Open Source the main Twitter server system structure NOW. Before it gets cloned all over the place. (As happened with YouTube, etc)

All except the SMS layer. There is a huge potential business model in then creating that connection between all the various ‘TwitterPlanets’ in the ‘TwitterVerse’ to that SMS layer to enable that which is most valuable – staying in touch with the network while away from the desk or internet using a device most of us already have in our pockets.

The potential here and NOW is huge. They could wrap this up. Think of all the extra features that could come from it. Think of all the useful ‘special agent bots’ – each with different abilities from different (Twitter)planets. How that could also help the ‘mother hub’ itself. It’s almost a model of what will happen when Linden opensource their Server system. The universe, metaverse and Twitterverse will benefit.

What do you think?

Using PHP to connect to the new Google Blogger API

blogmove.gifNow, I have been battling with this on and off for ages. Soon Google will be moving all ‘old’ Blogger accounts over to their Google Account system. This means that all those people who have third party applications to post to their blogspot Blogger accounts will need to switch over to the Google login and system (and get a Google Account, if they don’t already have one) – rather like Yahoo! will be doing to flickr users on the Ides Of March – Beware! 🙂

All these third party apps will need to be upgraded too. The thing is, we all want security right? So, you really want to go and register your application with Google to remove the big yellow Warning box you might start seeing a lot of soon.

The documentation to do this with PHP has been non-existent, which I found pretty weird as I bet there are plenty of PHP-based systems out there offering the ability to post to Blogger. (BlogHUD is one that I created for Second Life, which is a model system for something bigger and ‘real’ I have planned soon)

So, for those of you out there who are looking to do this for your own PHP systems hop on over to this post of mine on the Google Group for Google Accounts (crossposted to the Blogger Dev Group) and see the link to the source PHP example I have provided down at the bottom of that post.

For those who can’t be arsed reading all the intro and explanation, here is a link to the PHP source example, where there are plenty of comments to explain what is going on, each step of the way.

This example only goes as far as listing a users’ blogs, after obtaining a non-expiring secure token for your users, which itself has to be generated using secure signing methods. You’ll want to use this new-found knowledge to do cool stuff like post to the users’ blogs.

http://kosso.co.uk/PHP/blogger_google_secure_AuthSub.phps

Man, am I glad to get that bug out of my head! It’s been there for months!!! I hope this helps others get the same out of theirs! 🙂

You should be able to use this example to build a connection to any of the Google services. This is just using Blogger.

I will finish by saying that WordPress support for doing the same thing is EASY!! No problems. Ever. Whatsoever. Great job! 🙂 Rockin!

I’ll also add that I don’t do this sort of thing much – and by that I mean posting my code up online. But I have learned SO MUCH (if not all foundation knowledge) on the web, that doing stuff like this makes me feel good. I can feel the Karma restoring – step by step 😉

Blogger Google Data support?

OK. So I have recently been working to support the new Blogger / Google logins to post to Blogger blogs. I was easily able to register my app to remove the warning on the login page, but they offer no support of how to actually ‘sign’ the request to keep them secure.

I have posted to both the Blogger Data API Group and the Google Accounts API Group but it seems like I am dealing with some kind of ‘dark art’.

I think it’s a good idea to make connection for secure for people, but they are about to ‘force’ their bloggers to the new system, yet offer no support on how application developers like myself are to support this new ‘secureness’.

Even the Zend GData framework, which is available does not appear to handle the secure method required. I also cannot use this without upgrading my PHP and installing some more stuff. But there is no need, as PHP and Curl can do the job required just fine.

For those who may be able to help, here are the docs for the signing I am on about. But there’s just not enough info there on how to do it.

When I get this working, I’ll be happy to share how I did it.

Anyone got any ideas? I have the insecure method working fine.

Argh!

‘Codecasting’

Over on Scripting News, Dave Winer has been talking about the concept of ‘codecasting’ whereby instead of audio or video being sent via an RSS enclosure, a software update for the receiving app could be downloaded and installed.

This is very much like the way that all Dave’s Frontier-based applications have updated for some time, I believe.

I have been suggesting alternate uses for the RSS enclosure for some time myself. But also leveraging the very nature and characteristics of OPML and RSS too.

I think that the distributed media network model provided by an approach of ‘OPML plus RSS to the Power of Users’ – as in development at podcast.com ) could also power a software documentation system. I have also suggested this could also power the perfect forum software, but more on that in another post)

Imagine a directory where all the top level folders were software vendors. The next level would be software languages and applications.

Then the next level, drilling into the folder (via OPML inclusion) would be the language/software API itself. A list of each method/verb etc. These could even be categorised prior to this list, depending on the software it is documenting.

Each method/verb link in this OPML list would link to an RSS feed. IE: Every function available has its own RSS feed. The title of the feed is the name of the verb, the description is the description of the function being documented, with an example.

Then every RSS feed item below it is actually the user/developer generated content – the cool snippets of code – the wisdom – the experience : the BEST bits. 🙂 Look at PHP.net and see that often the most useful information on each function page is actually the list of submitted comments below the official instructions. Also see Macromedia/Adobe’s LiveDocs. Most APIs have a tree like structure which OPML lends itself to building very easily.

Touching briefly on the concept that OPML alone could power forum applications, then the depth of communication and knowledge available for future groks is incredible.

And the best thing being is that all this would be ‘WELL-FORMED’ data. It could document almost any software language ever made.

ps: I am suggesting all this to the owners of software.com – for like podcast.com, I believe that generic domains should do what they ‘have a duty to do‘. Anything else, and they are merely squatters trying to make a fast buck. (imho)

mymoblog, hismoblog, mybloghud, etc, etc

THEIR APIS!

It’s funny seeing Dave’s mymoblog.wordpress.com posts.  The early posts look just like my bloghud.wordpress.com or bloghud.blogspot.com accounts 😉

We developers like to talk to ourselves while testing (move long – nothing to see here 😉

What other free blogging systems should I support? All of them. Including the pay ones. But if those people who run pay blogging systems (6apart etc.) want support, I’ll need a free acount (dev account) please. Thank you.

You know it’s worth it 😉


Who is this ‘kosso’ anyway?

I am a 'Createc'. A creative technologist, entrepreneur/ hacker/ geek. Worked on building things on the web for over 12 years.

Used to work at BBC News interactive and created the publishing and delivery systems for video news to get distributed on huge screens in major railway stations around the country.

I left the BBC to become CTO / sole-lead architect/developer at podcast.com for three years.

I have now left them to build a start up a new system called 'Phreadz', which is a 'Social Multimedia Conversation Network', integrating everything that is 'V.I.T.A.L' to us on the web. Video, Images, Text, Audio and Links.

I built the whole thing my myself. I programmed every line of code and positioned every pixel. I'm looking forward to attracting an hiring new members of the team to help me out! :)

There are currently over 1000 happy and helpful beta testers on the system so far and one client of a white-labelled solution.



@kosso : twitter

kosso's flickr stream

IMG_5559

Bristol Panoramic

Printed Paint-pot Angel

Mobile Lovers

Paint Pot Angel

The Punishment Book

School Days

School Days

School Days

School Days

More Photos
April 2017
M T W T F S S
« Apr    
 12
3456789
10111213141516
17181920212223
24252627282930

stats

  • 253,538