]> git.etc.gen.nz Git - whoisi.git/commitdiff
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 204eabf0862d318b1a3c0f817c9ff882e44d1625..c4dd9783a70199f5e3bef50d21b9345e4403fc61 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 bec205775dc8c9614a3d77467c6308739bd5ac8f..8c0ade4f2ba44699e4acb16bbb6b6441c18c37be 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 5637e8e63e0caaa3ae2ed691c5c39d278ccb8f03..d6da11c343bed221ed2a7eb4f49cf2aa648c4ca2 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()