Showing posts with label howto. Show all posts
Showing posts with label howto. 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

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

Sunday, July 29, 2007

A Googlewhack approach to be a Googlewhacker!

Googlewhack, for those who have been living in a dream world and do not know what 'the one' is, is a search query consisting of only two words entered into Google's search page that results in one & only one result - and then, there are rules [Follow this to read the rules].

Googlewhacking is the pastime of finding a Googlewhack.

Googlewhacker is a person Googlewhacking.

Now, after all these definitions to get the 'no idea' reader interested, let's get to the story. Let me be right to the point.

For the uninitiated, starting from random words would take ages - and one may still not become a Googlewhacker. There are small scripts floating around the net to get to such queries, but there is hardly one with 'something to write home about' success rate!

A GOOGLEWHACK APPROACH. [+/-]



Thanks to my friend, Prashant Gaharwar, for his help in Googlewhacking.

Happy Googlewhacking!

- Pag 'Googlewhacker' Floyd :D

P.S. The list of recent Googlewhacks is here...


Read more...



Post to del.icio.us

Friday, July 27, 2007

How to show Images uploaded on Blogger in a Modal Window using Lightwindow

If one has been following this post, he/she would be happy that 'phydeaux3' suggested the possible cause and a solution to the problem. phydeaux3's original comment in full body & soul can be viewed here.



Quoting phydeaux3's comment:

"Actually, the problem most likely resides in the peculiar way blogger image hosting works. By default, the large linked image is in a format (I'm using yours as the example and only showing the last relevant bits of the url)

/s1600-h/mpro.jpg

If you view that image directly, you'll find that Picasa Web Albums (which is the actual image host for blogger) makes this NOT an actual image file, but an html page, with an image embedded in it (view source). What that means is, the large image cannot be used as in in an image tag, but only viewed directly. But if you cut out the -h in the folder name
s1600/mpro.jpg
That gives an image that CAN be used in an image tag, and presumeable in your scripts as well (but cannot be viewed directly, as it will prompt for a file down load..yeah it's odd). So remove the -h from the last folder name and try it.

(there also may be referrer restrictions on images larger than 800px in size, but I haven't messed with it lately)."

Here, I put the above to the original test (without '-h' in the target url):
Without a doubt, it works! Hail phydeaux3 :)


Read more...



Post to del.icio.us

Thursday, July 26, 2007

How to Widgetize your RSS feeds?

Here is a step-by-step guide to Widgetize (Desktop or Web) your (or any) RSS feed, just like the one on this blog on the right (Web-based), powered by MuseStorm.
  1. Go here, if you haven't already joined or else here to login.

  2. You will be taken to the 'Dashboard' after logging in.

  3. Click on the button 'Widgetize a Feed'

  4. Enter your feed URL (e.g. if you have a BLOGGER account, your feed would be 'http://www.[blog-name].blogspot.com/feeds/post/default') & Click on 'Add Feed'.

  5. In the Widgetize Feed form that pops up after step 4, enter mandatory (*) and optional fields - also 'check' on 'Web Widgets' + 'Desktop Widgets' (currently supports 'Yahoo Widgets' & 'Google Gadgets')

  6. If all goes well, you will see 'Your widgets are ready!'

  7. You can download the Desktop Widgets or click on 'view' for the Web Widget to configure it.

  8. When 'configured', click on 'widgetize' to get the code for 'Web-Widget' to be put on any website.

  9. In case of blogger, the instructions (directly copied from the source) are:

    1. Login to your Blogger account

    2. Select your blog from the dashboard

    3. Click the "Layout" link

    4. Select "Add a page element"

    5. Select a "HTML/JavaScript" element

    6. Give the element a title and paste the HTML snippet into the content field

    7. Hit "Save changes"

    8. OR, directly edit the template's HTML
Happy Widgetizing!


Read more...



Post to del.icio.us