Posts Tagged ‘friendfeed’

Use FF To Go on an iPhone? Consider the Official Version

Tuesday, July 1st, 2008

I built FF To Go knowing that it was only a matter of time before FriendFeed would build an official mobile FriendFeed experience.  So when FriendFeed announced an iPhone friendly FriendFeed I wasn’t shocked nor saddened.

FF To Go wasn’t really built for iPhone users; it was built for everyone else.  See the iPhone supports Javascript which meant the original FriendFeed interface worked decently on the iPhone.  Every other phone on the market doesn’t support Javascript and since the FriendFeed interface (both of them) rely upon Javascript for commenting/liking it won’t work on any other phone.  That’s where FF To Go comes in.  It uses zero Javascript so FriendFeed doesn’t remain a passive experience for non-iPhone mobile users like myself.

So if you were using FF To Go on an iPhone please switch over to the official version.  Don’t feel ashamed to use a superior product.

Thanks FriendFeed!

RSSmeme Supplementing Data From FriendFeed

Friday, June 13th, 2008

RSSmeme is about to be faster than ever at finding the hot news of the day.  Everyone knows that FriendFeed is fast; and I’m not talking about the speed at which the site loads (which is very fast).  FriendFeed is extremely quick at crawling.  RSSmeme takes 7 hours to do a round trip of it’s nearly 15000 feeds but FriendFeed is able to pick up your shared items in minutes.

So I’m now leveraging that data in RSSmeme by utilizing the FriendFeed API.  This meant a lot of database and code restructuring because the data coming from FriendFeed doesn’t have some extra meta data including content, author, source, or tags so you may see some blank entries from time to time in RSSmeme (especially on the Recent tab) but hopefully that data will fill itself in as RSSmeme finds your shared items the old fashioned (slow) way.

I expect some bugs to crop up (particularily time zone issues) but I’ll squash them as fast as I can.  This is an exciting day for RSSmeme; things are about to get a whole lot faster.

friendfeed.py Patch for use on Google App Engine

Thursday, May 29th, 2008

Ask and ye shall receive.  Attached is a patch for using friendfeed.py on Google App Engine.  You need to also have demjson available.  Google App Engine does not allow use of many C modules (like cjson) and both json and simplejson will throw decoding errors from time to time. demjson is slow but won’t throw errors around (I really wish we could use cjson; it’s so much faster).

Basically the differences are:

  1. Use urlfetch instead of urllib2
  2. Use Django’s urlencode which will work with unicode (letting you comment/share in languages like Chinese)
  3. Use demjson instead of cjson (which cannot be used on Google App Engine), simplejson, or json (which both throw decoding errors from time to time)

Enjoy!

Update:

You don’t need to use demjson anymore; simplejson will work just fine.  I just got an email from Sanjeev saying that they fixed the issue (’\x’ is not valid JSON).  This makes things even easier because simplejson is included in Django (from django.utils import simplejson) which is included in Google App Engine.

Google App Engine + Memcached + FF To Go = Bliss

Wednesday, May 28th, 2008

Google App Engine gained support for memcached today, a very high performance caching system, and I’m already using it in FF To Go.

I’ll share some code with you so you know how it works.  This is the code that renders the public feed:

def public(request):
    f = friendfeed.FriendFeed()
    try:
        start = int(request.GET.get('start', 0))
    except:
        start = 0
    service = request.GET.get('service', None)
    num = int(request.session.get('num', NUM))
    key = 'public_%i_%i_%s' % (num, start, service)
    data = memcache.get(key)
    if not data:
        try:
            data = f.fetch_public_feed(num=num, start=start, service=service)
        except Exception, e:
            return HttpResponseRedirect('/%s/' % e)
        memcache.set(key, data, CACHE_TIME)
    extra_context = {
        'entries': data['entries'],
        'next': start + num,
    }
    if start > 0:
        extra_context['has_previous'] = True
        extra_context['previous'] = start - num
    return render_to_response('public.html', extra_context, context_instance=RequestContext(request))

And that’s it!  The FriendFeed team should be happy; I’m using less of their resources because I don’t need to query them as much as I used to.  Now this is really only useful on the FriendFeed public feed because all other feeds are likely to be accessed using your FriendFeed credentials and have user specific differences (ie hiding settings) which we don’t want to cache but the public feed does not respond to your hide settings so it is a good candidate.  It’s nice to see that using memcached on Google App Engine is no different from using it on your own server.

Am I the first to use memcached on Google App Engine?

FF To Go Learns To Search!

Monday, May 26th, 2008

Not much to say other than have at it: http://www.fftogo.com/search/