Recent Updates RSS Toggle Comment Threads | Keyboard Shortcuts

  • Chirag 3:56 pm on January 4, 2010 Permalink | Reply
    Tags: 2009, Favorites   

    2009 Favorites 

    Some books I liked this year:

    Music

     
  • Chirag 12:40 pm on January 1, 2010 Permalink | Reply  

    Smushing Popular Logos 

    Site Image Result Savings %Savings
    Gmail 8.74 KB 2.65 KB 23.29%
    CO2Stats 3.28 KB 5.29 KB 61.73%
    Twitter 5.78 KB 733 bytes 11.01%
    Techcrunch 1.60 KB 1.45 KB 47.5%
    Yahoo! News 1.26 KB 43 bytes 3.23%
    Facebook 2.60 KB 46 bytes 1.7%
    CNN 6.37 KB 1.18 KB 15%
     
  • Chirag 12:40 pm on August 6, 2009 Permalink | Reply
    Tags: radiohead   

    Go buy the new Radiohead song “Harry Patch (in memory of)” here: http://download.waste.uk.com/Store/did.html

     
  • Chirag 11:34 am on July 17, 2009 Permalink | Reply  

    The man with two brains! http://www.wimp.com/twobrained/

     
  • Chirag 2:16 pm on July 12, 2009 Permalink | Reply  

    Planet Earth Time Lapse + The Album Leaf (The outer banks): http://bit.ly/zf0VC

     
  • Chirag 3:38 pm on July 7, 2009 Permalink | Reply  

    My favorite in the authors@google series – “interactions between faith and science” http://bit.ly/IOUTt

     
  • Chirag 12:09 am on June 22, 2009 Permalink | Reply
    Tags: flying   

    F14 Tomcat – http://www.youtube.com/watch?v=V8rZWw9HE7o (Highway to the Dangerzone)
    Lockheed SR-71 Blackbird – http://www.youtube.com/watch?v=BlJNYxoBX6w (Pink Floyd, Learning to Fly)

     
  • Chirag 12:47 pm on May 31, 2009 Permalink | Reply
    Tags: Hacks, oauth, yql   

    YQL OpenSocial Client 

    Here is a YQL open data table that allows developers to use SQL-like
    SELECT syntax on top of the OpenSocial REST people API.

    Note: This open data table only covers the people API and needs some
    more work to be useful for developers. Also, it requires the HTTPS
    protocol since private keys are being transmitted.

    Example query: http://tinyurl.com/qnfnzn (Uses the guid, ck, and cks
    from the sample code in the opensocial php client)

    Source code for the opensocial.people open data table:

    http://github.com/chirags/yql-tables/blob/d1f5d12d6e8d5e7d9424db5c869082abfcd469cd/opensocial/opensocial.people.xml

    <?xml version="1.0" encoding="UTF-8" ?>
    <table xmlns="http://query.yahooapis.com/v1/schema/table.xsd" https="true">
      <meta>
        <author>Chirag Shah</author>
      </meta>
      <bindings>
        <select itemPath="" produces="XML">
          <urls>
            <url>http://sandbox.orkut.com/social/rest/people/</url>
          </urls>
          <inputs>
            <key id='method' type='xs:string' paramType='variable' const="true" default="opensocial.people" />
            <key id='ck' type='xs:string' paramType='variable' required="true" />
            <key id='cks' type='xs:string' paramType='variable' required="true" />
            <key id='guid' type='xs:string' paramType='variable' required="true" />
            <key id='selector' type='xs:string' paramType='variable' required="true" />
            <key id='count' type='xs:string' paramType='variable' required="true" default="20" />
            <key id='container' type='xs:string' paramType='variable' required="true" />
          </inputs>
          <execute><![CDATA[
            // Include the signing library
            y.include("http://oauth.googlecode.com/svn/code/javascript/oauth.js");
            y.include("http://oauth.googlecode.com/svn/code/javascript/sha1.js");
     
            var base;
            if(container == 'orkut') 
                base = 'http://sandbox.orkut.com/social/rest/people/';
            else if(container == 'friendconnect')
                base = 'http://www.google.com/friendconnect/api/people/';
            else
                base =  '';
     
            var requestUrl = base + guid + '/@' + selector + '/';
            var accessor = {consumerSecret: cks};
            var message = {
                method: "GET",
                action: requestUrl,
                parameters: [
                    ['oauth_signature_method', 'HMAC-SHA1'],
                    ['oauth_consumer_key', ck],
                    ['oauth_version', '1.0'],
                    ['xoauth_requestor_id', guid],
                    ['format', 'json']
                ]
            };
     
            OAuth.setTimestampAndNonce(message);
            OAuth.setParameter(message, "oauth_timestamp", OAuth.timestamp());
            OAuth.SignatureMethod.sign(message, accessor);
            var finalRequestUrl = OAuth.addToURL(message.action, message.parameters);
            response.object = y.rest(finalRequestUrl).get().response;
          ]]></execute>
        </select>
      </bindings>
    </table>
     
  • Chirag 9:15 pm on March 22, 2009 Permalink | Reply  

    [python] Post a list of links to delicious 

    Simple script to post a list of links to delicious, along with the related tags for that link.
    Yes, I also wish delicious.com supported OAuth

    import os, urllib, urllib2, time, sys
    from BeautifulSoup import BeautifulSoup
    from BeautifulSoup import BeautifulStoneSoup
     
    user = 'insert_the_user_name'
    pasw = 'insert_the_password'
    password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()
    password_manager.add_password(None, 'https://api.del.icio.us/', user, pasw)
    auth_handler = urllib2.HTTPBasicAuthHandler(password_manager)
    opener = urllib2.build_opener(auth_handler)
    urllib2.install_opener(opener)
     
    for url in open('./all_links.txt'):
        try:
            title = urllib.quote(BeautifulSoup(urllib.urlopen(url)).title.string)
            url = urllib.quote(url)
            tags = "hn_links"
            for suggestion in BeautifulSoup( urllib2.urlopen("https://api.del.icio.us/v1/posts/suggest?url=%s" % url).read()).findAll('popular'):
                tags = tags + "+" + suggestion.string
            print urllib2.urlopen("https://api.del.icio.us/v1/posts/add?url=%s&tags=%s&description=%s" % (url, tags, title)).read()
            time.sleep(9)
        except:
            print sys.exc_info()
     
  • http://chiragshah.tumblr.com/ 1:03 am on January 20, 2009 Permalink  

    Video 

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
esc
cancel