2008-09-30 Christopher Blizzard <blizzard@0xdeadbeef.com>
authorblizzard <blizzard@ae879524-a8bd-4c4c-a5ea-74d2e5fc5a2c>
Tue, 30 Sep 2008 23:47:06 +0000 (23:47 +0000)
committerblizzard <blizzard@ae879524-a8bd-4c4c-a5ea-74d2e5fc5a2c>
Tue, 30 Sep 2008 23:47:06 +0000 (23:47 +0000)
        * tests/nose/test_newsite.py (TestNewSite.test_delicious): Add
        test cases for new style delicious urls.

        * services/command/delicious.py (Delicious.isDelicious): Add
        support for new-style delicious urls.

git-svn-id: svn://trac.whoisi.com/whoisi/trunk@2 ae879524-a8bd-4c4c-a5ea-74d2e5fc5a2c

ChangeLog
services/command/delicious.py
tests/nose/test_newsite.py

index 204eabf..c4dd978 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-09-30  Christopher Blizzard  <blizzard@0xdeadbeef.com>
+
+       * tests/nose/test_newsite.py (TestNewSite.test_delicious): Add
+       test cases for new style delicious urls.
+
+       * services/command/delicious.py (Delicious.isDelicious): Add
+       support for new-style delicious urls.
+
 2008-09-19  Christopher Blizzard  <blizzard@0xdeadbeef.com>
 
        * utils/utils.cfg: New file for utils that includes database
index bec2057..8c0ade4 100644 (file)
@@ -32,15 +32,20 @@ class Delicious:
         path = u[2]
 
         # site url
-        # http://del.icio.us/chrisfralic - base
+        # http://del.icio.us/chrisfralic - base (old style)
+        # http://delicious.com/chrisfralic - base (new style)
 
         # feeds
         # http://del.icio.us/rss/danicomar - bookmarks
         # http://feeds.delicious.com/rss/danicomar - bookmars after redirect
+        # http://feeds.delicious.com/v2/rss/chrisfralic?count=15 (new form)
         # http://del.icio.us/rss/tags/danicomar - tags (do not want)
         # http://feeds.delicious.com/rss/tags/danicomar - tags after redirect (do not want)
 
-        if host == "del.icio.us" and re.match('^/([^/]+$)', path):
+        if (host == "del.icio.us" or host == "delicio.us" or host == "delicious.com") and re.match('^/([^/]+$)', path):
+            return True
+
+        if host == "feeds.delicious.com" and re.match('^/v2/rss/([^/]+$)', path):
             return True
 
         return False
index 5637e8e..d6da11c 100644 (file)
@@ -77,11 +77,15 @@ class TestNewSite(unittest.TestCase):
         Test to make sure we can detect del.icio.us urls
         """
         good_urls = ['http://del.icio.us/something',
-                     'http://del.icio.us/foo']
+                     'http://del.icio.us/foo',
+                     'http://delicious.com/foo',
+                     'http://delicio.us/foo',
+                     'http://feeds.delicious.com/v2/rss/chrisfralic?count=15']
 
         bad_urls = ['http://del.icio.us/',
                     'http://del.icio.us/something/rss',
-                    'http://something.else']
+                    'http://something.else',
+                    'http://feeds.delicious.com/v2/rss/tags/chrisfralic?count=15']
 
         for i in good_urls:
             x = Delicious()