Commits

Marcin Kasperski committed 4ac0109

Final cleanup.

  • Participants
  • Parent commits 652706c

Comments (0)

Files changed (3)

 mekk.postrank
 =============
 
-Beware
-======
-
 **Postrank is dead, they were acquired and closed by Google. So this module is no longer of any use.**
 
 I leave it in case some dependencies or links are left somewhere.
 
-Introduction
-=============
-
-Extremely minimal PostRank client.
-
-At the moment only feed status checking is implemented. Other functions may
-be implemented some day ... or not.
-
-Sources, patches, bug reports
-=============================
-
-Source code is available on `BitBucket`_. The same page can be used
-for bug reporting and for patch submission.
-
-.. _BitBucket: http://bitbucket.org/Mekk/mekk.postrank
-

File sample/test_postrank_client.py

-# -*- coding: utf-8 -*-
-
-from mekk.postrank import PostRankClient
-from pprint import pprint
-
-pr = PostRankClient("mekk.waw.pl/test")
-
-for url in [
-    "http://feeds.feedburner.com/SmashingMagazine",
-    "http://feeds.mekk.waw.pl/NotatnikZapisywanyWieczorami",
-    ]:
-    print 
-    print url
-    print
-    pprint(pr.feed_info(url))
-

File src/mekk/postrank/postrank_client.py

 # -*- coding: utf-8 -*-
 
-import urllib, urllib2
-import re
-import simplejson
-import time
-
-import logging
-log = logging.getLogger("postrank")
-
-POSTRANK = 'http://api.postrank.com/v1/'
-
 class PostRankClient(object):
-    """
-    PostRank (http://www.postrank.com) access client.
-
-    At the moment only one function is implemented.
-    """
 
     def __init__(self, appkey):
-        """
-        appkey - symbolic application identifier, for example domain name
-        """
-        self.appkey = appkey
+        raise Exception("PostRank is closed")
 
     def feed_info(self, feed_url):
-        """
-        Returns PostRank information about given feed.
-
-        Returns either dictionary with feed details, or None (that means
-        that feed info is not currently available but may appear in the future.
-
-        In case dictionary is returned, it consists of the following fields:
-        - title  (blog/site/feed title)
-        - description (subtitle)
-        - link (blog - not feed - URL)
-        - xml (feed URL)
-        - id (some internal identifier)
-        - tags (list of dictionaries, every dictionary consists of fields count and name)
-        - topics (?),
-        - ttl (?)
-
-        Note those fields may change if PostRank API changes.
-        """
-
-        query = {
-            'appkey' : self.appkey,
-            'format' : 'json',
-            'id' : feed_url,
-            }
-        enc_query = urllib.urlencode(query)
-
-        url = "http://api.postrank.com/v2/feed/info?" + enc_query
-
-        request = urllib2.Request(url.encode('utf-8'))
-
-        log.info("Calling: %s" % request.get_full_url())
-        try:
-            f = urllib2.urlopen(request)
-        except urllib2.HTTPError, e:
-            if e.code == 202:
-                log.info("HTTP:202 (accepted) - feed accepted for processing")
-                return None
-            else:
-                raise
-        result = f.read()
-        log.debug("Result: %s" % result)
-
-        return simplejson.loads(result)
-
+        raise Exception("PostRank is closed")