Showing posts with label api. Show all posts
Showing posts with label api. Show all posts

Friday, August 10, 2007

Build a Quick 'Google Maps' Mashup with Google Mashup Editor

Google Mashup Editor (GME) is an online 'mashup' building tool by Google, just like Yahoo! Pipes & Microsoft Popfly, but quite different per se. Right now, it's use is only on an invitational basis so those reading this but do not have an account can register at GME's site for an invitation.

This is a quick walkthrough of my first mashup using GME - BlogUSphere Moods! GME mainly works on the premise that user has access to an RSS feed of the data he wants to do a mashup of - and it's premise is not far-fetched if you know about Yahoo! Pipes and services like dapper. Even the GME FAQ claims Pipes and GME are friends not foe. So, let's explore it, but before that I must add, GME is best suited for Google Maps Mashups [just because it makes them so ridiculously easy to build].

OK, heard of 'We Feel Fine'? These guys search the blogosphere for posts containing 'feelings' [keywords like: happy, sad, fine etc.] and index them [with hordes of information]. They have made this information available freely through an API. I decided to make a quick mashup based on it - to show recent moods of bloggers on google maps. Earlier my plan was to include blogger emotions from around the world but for some cryptic reason [& I being very impatient to sort that out] I wasn't able to obtain entries from other countries on my first try but only the US. Thus, my mashup name has - blogUSphere - in it. Actually, it was a problem with the URL but yawwwnnn...

Moving on. It's a REST API [Go here for the docs]. So obtaining results was easy, through Pipes. See my pipes code. For first time users, I can only say that explore it, it's too easy - just take a look at some Perl's RegEx tutorial. It'd come handy. Also, note how I 'renamed' the tags to title, link, description [standard RSS] & geo:lat, geo:long [needed to enable Google Maps to fetch lat-long data in GME]. Now, save your pipes app, and obtain RSS feed of it.

Open GME - goto Feed browser - select 'Remote Feed' - paste your feed URL and see the results. This was just to ensure that every tag is in place. Now, if you are not a stickler for looks 'n all then all you need to do is: open Sample projects in the editor, browse to the Maps mashup sample app and replace the feed url written in it's code [look closely, it's written somewhere] with your pipes RSS feed url. Run it in Sandbox. It'll work! [adjust pagesize]. Howzzaat?

It took me 73 minutes - and you being a smart-ass would't take more than 7+3=10 mins. Go build your own mashAPP!

P.S. You can add JS code in GME - so the first things that came into my mind was 'Adsense' ;) ...and it works in it! [For some reason [given in gme groups] it wouldn't work inside tables]
P.S. 2: Also, the RSS feed is cached in GME and the crawler goes out to 'crawl' in a 30-60 mins. interval time - so, don't panic if you don't see your feeds updating - it's a limitation with GME right now.


Read more...



Post to del.icio.us

Monday, August 06, 2007

Technorati API Wiki spammed beyond recognition, help to rebuild!

The Tehcnorati API wiki has been spammed badly and I think, needs the help of the active developer community to put it back into shape.

This page [link] shows all kinds of spam keywords. The wiki says it was last editted on 3rd August. Also, the link to technorati api from programmable web [link] takes to a page spammed with this note:

"Please Spam this page
Something not useful should be here

Ciaran"

Not a pretty sign for a popular site's wiki. Let's put it back into action.



Read more...



Post to del.icio.us

Sunday, August 05, 2007

diggTraitor - Identify Fans NOT Digging You!

Based on the Digg API, diggTraitor is windows-based desktop tool to 'Identify the unDiggly Fans'. It's a fun tool developed by me, to just explore the digg API and look at a funny side of it. Sort out fans who do not Digg your 'most vaunted' stories! It's version is 0.5. I am planning for version 1.0 to have some 'Traitor Ping' functionality to directly let them know that the user isn't happy about not digging a 'diggable' story.

Talking more about diggTraitor [sounds like 'dictator'] - I have developed it in C# on .NET framework 2.0 so, one would need .NET framework 2.0 to run this application.

Write in for comments, bugs or help. If someone needs to take a look at the source-code, feel free to drop a comment or an e-mail [my e-mail address: pag.floyd@gmail.com]

You can download diggTraitor from: [mihd link] [rapidshare link] 24.5 KB
If you are not able to download, please inform me.
Some screenshots of diggTraitor v0.5:



Happy Digging!


Read more...



Post to del.icio.us

Friday, August 03, 2007

.NET Library for Digg API - Making it work!

While looking for a .NET library for Digg API, I found two (the reader may suggest more, if any, in the comments). One goes by the name 'Baileysoft.Rss.DiggAPI' which has recently been added at codeproject by thund3rstruck and comes with a good tutorial and the api code - all of it to be found here. Nothing much to say about it as the tutorial is well-written and the author promises to add more functionality soon [not all Digg API calls have been implemented].

The other that I found is here which is fairly old and in all probability, it's development has been discontinued. It goes by the name 'DiggTools'. It's development was part of 'Google Code' and the web-page hasn't been updated since quite a while both at the original site and the Google page of the project. The download page [for an Aug. 9th 2006 release] says, "This version implements roughly 90% of the known Digg.com API. It is considered beta quality with newer versions expected shortly."

Since it's old, 'DiggTools' doesn't use an appkey that's required now. That wouldn't have been a problem if the download had the source code, but there was only a DiggTools.dll at the download location. Since, it implements quite a few API calls, I decided to bring it into running condition again. There is an API's google group which proved to be of some help and also, thund3rstruck's DiggAPI. In addition, DiggTools library is licensed under LGPL, so I am not making available the modified code - instead, here are the instructions to make it run for those who want to use it.


  • First, we only have the dll file so, download Reflector to decompile DiggApi.dll to C# code. It does it fairly efficiently and we get all the code files.

  • Now, open DiggTools solution in VS (assuming), open StoryFactor.cs - right click on references & add System.dll in it.

  • Add, using System.Net; at the top.

  • Add "+ &appkey=http%3A%2F%2Fwww.unique.com&type=xml" to end of following four lines:

    • string str = "http://services.digg.com/stories" + filter + this.parseSearchOptions(theOptions);

    • string filename = "http://services.digg.com/story/" + Convert.ToString(storyID) + "/activity?period=" + time;

    • string filename = "http://services.digg.com/stories/" + Convert.ToString(storyID);

    • string filename = "http://services.digg.com/stories?count=1";

  • As you know you can add any unique app key. Also, one may define a global variable for the appkey to avoid this tedious task.

  • Now, find this method: GetStories(string filter, SearchOptions theOptions) and inside the body of the first try{} statement inside the method, replace everything with the following code:

HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(str);
webRequest.UserAgent = ".NET Framework digg Test Client";
webRequest.Credentials = System.Net.CredentialCache.DefaultCredentials;
webRequest.Accept = "text/xml"; HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
System.IO.Stream responseStream = webResponse.GetResponseStream();
this.theXmlDocument.Load(responseStream);

  • Also, search for "min_date" & "max_date" and replace it with "min_submit_date" & "max_submit_date" in the same file.

  • Now, you are good to go. Build -> Goto 'bin' folder -> Fetch 'DiggTools.dll' -> Use it in your app!
Happy Coding!

P.S. Write in for comments, suggestions, brickbats!


Read more...



Post to del.icio.us