[google-sgnodemapper] r238 committed - Add rules for plaxo.com (why did I not do this earlier, lol?!).

1 view
Skip to first unread message

codesite...@google.com

unread,
Sep 17, 2010, 11:57:09 PM9/17/10
to sgnodemapp...@googlegroups.com
Revision: 238
Author: jsmarr
Date: Fri Sep 17 20:56:09 2010
Log: Add rules for plaxo.com (why did I not do this earlier, lol?!).

http://code.google.com/p/google-sgnodemapper/source/detail?r=238

Modified:
/trunk/autogen/nodemapper.js
/trunk/autogen/nodemapper_debug.js
/trunk/autogen/nodemapper_tests.js
/trunk/sites/simple.js

=======================================
--- /trunk/autogen/nodemapper.js Tue Aug 24 12:17:37 2010
+++ /trunk/autogen/nodemapper.js Fri Sep 17 20:56:09 2010
@@ -1341,6 +1341,27 @@
nodemapper.addSimpleHandler("digg.com", "ident_to_rss",
"http://digg.com/users/", "/history/diggs.rss");
nodemapper.registerDomain(
+ ["plaxo.com", "myplaxo.com"],
+ {name: "Plaxo",
+ primaryDomain: "plaxo.com",
+ identRegexp: /^[A-Za-z][\w\.-]*$/,
+ urlToGraphNode: nodemapper.createFirstMatchHandler([
+ nodemapper.createPathRegexpHandler(
+ "plaxo.com",
+ new RegExp("^/profile/show(?:Public)?/([A-Za-z][\\w.-]*)(?:/|
$|\\?)")),
+ nodemapper.createSomethingSlashUsernameHandler(
+ "profile/show(?:Public)?",
+ "plaxo.com",
+ {keyName: "pk"}),
+ nodemapper.createHostRegexpHandler(
+ "plaxo.com",
+ new RegExp("([\\w\\-]+)\." + "myplaxo.com" + "$", "i"))
+ ])});
+nodemapper.addSimpleHandler("plaxo.com", "ident_to_profile",
+ "http://www.plaxo.com/profile/showPublic/", "");
+nodemapper.addSimpleHandler("plaxo.com", "ident_to_rss",
+ "http://www.plaxo.com/profile/publicRss/", "");
+nodemapper.registerDomain(
"pownce.com",
{name: "Pownce",
urlToGraphNode: nodemapper.createPathRegexpHandler(
@@ -1810,6 +1831,24 @@
"user/-", "foursquare.com", {keyName: "pk"})});
nodemapper.addSimpleHandler("foursquare.com", "pk_to_profile",
"http://foursquare.com/user/-");
+var wretchHandler = function(url, host, path) {
+ var WR_PROFILE_REGEX =
+ /\/(user|blog|friend|album|video|join|
guestbook)\/[A-Za-z0-9\_]+.php\?id=([A-Za-z][A-Za-z0-9\.\_]+)/;
+ var WR_DEFAULT_REGEX =
+ /\/(user|blog|friend|album|video|join|
guestbook)\/([A-Za-z][A-Za-z0-9\.\_]+)/;
+ if (m = WR_PROFILE_REGEX.exec(path)) {
+ return "sgn://wretch.cc/?ident=" + m[2].toLowerCase();
+ } else if (m = WR_DEFAULT_REGEX.exec(path)) {
+ return "sgn://wretch.cc/?ident=" + m[2].toLowerCase();
+ } else {
+ return url;
+ }
+};
+nodemapper.registerDomain(
+ "wretch.cc",
+ {name: "wretch.cc", urlToGraphNode: wretchHandler});
+nodemapper.addSimpleHandler("wretch.cc", "ident_to_profile",
+ "http://wretch.cc/user/");
})();
(function(){
spinPkHandler = function(url, host, path) {
=======================================
--- /trunk/autogen/nodemapper_debug.js Tue Aug 24 12:17:37 2010
+++ /trunk/autogen/nodemapper_debug.js Fri Sep 17 20:56:09 2010
@@ -2060,6 +2060,28 @@
nodemapper.addSimpleHandler("digg.com", "ident_to_rss",
"http://digg.com/users/", "/history/diggs.rss");

+nodemapper.registerDomain(
+ ["plaxo.com", "myplaxo.com"],
+ {name: "Plaxo",
+ primaryDomain: "plaxo.com",
+ identRegexp: /^[A-Za-z][\w\.-]*$/,
+ urlToGraphNode: nodemapper.createFirstMatchHandler([
+ nodemapper.createPathRegexpHandler(
+ "plaxo.com",
+ new RegExp("^/profile/show(?:Public)?/([A-Za-z][\\w.-]*)(?:/|
$|\\?)")),
+ nodemapper.createSomethingSlashUsernameHandler(
+ "profile/show(?:Public)?",
+ "plaxo.com",
+ {keyName: "pk"}),
+ nodemapper.createHostRegexpHandler(
+ "plaxo.com",
+ new RegExp("([\\w\\-]+)\." + "myplaxo.com" + "$", "i"))
+ ])});
+nodemapper.addSimpleHandler("plaxo.com", "ident_to_profile",
+ "http://www.plaxo.com/profile/showPublic/", "");
+nodemapper.addSimpleHandler("plaxo.com", "ident_to_rss",
+ "http://www.plaxo.com/profile/publicRss/", "");
+
nodemapper.registerDomain(
"pownce.com",
{name: "Pownce",
@@ -2584,6 +2606,28 @@
nodemapper.addSimpleHandler("foursquare.com", "pk_to_profile",
"http://foursquare.com/user/-");

+var wretchHandler = function(url, host, path) {
+ var WR_PROFILE_REGEX =
+ /\/(user|blog|friend|album|video|join|
guestbook)\/[A-Za-z0-9\_]+.php\?id=([A-Za-z][A-Za-z0-9\.\_]+)/;
+ var WR_DEFAULT_REGEX =
+ /\/(user|blog|friend|album|video|join|
guestbook)\/([A-Za-z][A-Za-z0-9\.\_]+)/;
+
+ if (m = WR_PROFILE_REGEX.exec(path)) {
+ return "sgn://wretch.cc/?ident=" + m[2].toLowerCase();
+ } else if (m = WR_DEFAULT_REGEX.exec(path)) {
+ return "sgn://wretch.cc/?ident=" + m[2].toLowerCase();
+ } else {
+ return url;
+ }
+};
+
+nodemapper.registerDomain(
+ "wretch.cc",
+ {name: "wretch.cc", urlToGraphNode: wretchHandler});
+
+nodemapper.addSimpleHandler("wretch.cc", "ident_to_profile",
+ "http://wretch.cc/user/");
+
})();
// (end of included file sites/simple.js)

=======================================
--- /trunk/autogen/nodemapper_tests.js Tue Aug 24 12:17:37 2010
+++ /trunk/autogen/nodemapper_tests.js Fri Sep 17 20:56:09 2010
@@ -803,6 +803,31 @@

["urlToGraphNode", "http://foursquare.com/user/-123456789?mode=foo", "sgn://foursquare.com/?pk=123456789"],

["urlFromGraphNode", "sgn://foursquare.com/?pk=987654321", "profile", "http://foursquare.com/user/-987654321"],

["urlToGraphNode", "http://foursquare.com/user/-987654321", "sgn://foursquare.com/?pk=987654321"],
+
["urlToGraphNode", "http://wretch.cc/user/foobar", "sgn://wretch.cc/?ident=foobar"],
+
["urlToGraphNode", "http://wretch.cc/blog/foobar", "sgn://wretch.cc/?ident=foobar"],
+
["urlToGraphNode", "http://wretch.cc/blog/foobar/12345", "sgn://wretch.cc/?ident=foobar"],
+
["urlToGraphNode", "http://wretch.cc/blog/foobar&commentsRss20=1", "sgn://wretch.cc/?ident=foobar"],
+
["urlToGraphNode", "http://www.wretch.cc/user/profile.php?id=foobar", "sgn://wretch.cc/?ident=foobar"],
+
["urlToGraphNode", "http://www.wretch.cc/blog/blog.php?id=foobar", "sgn://wretch.cc/?ident=foobar"],
+
["urlToGraphNode", "http://www.wretch.cc/album/album_rss.php?id=foobar", "sgn://wretch.cc/?ident=foobar"],
+
["urlToGraphNode", "http://wretch.cc/user/FooBar", "sgn://wretch.cc/?ident=foobar"],
+
["urlToGraphNode", "http://wretch.cc/user/Foo.Bar", "sgn://wretch.cc/?ident=foo.bar"],
+
["urlToGraphNode", "http://wretch.cc/user/Foobar?bogus", "sgn://wretch.cc/?ident=foobar"],
+
["urlToGraphNode", "http://wretch.cc/user/FooBar/bogus", "sgn://wretch.cc/?ident=foobar"],
+
["urlToGraphNode", "http://wretch.cc/bogus/foobar", "http://wretch.cc/bogus/foobar"],
+
["urlFromGraphNode", "sgn://wretch.cc/?ident=foobar", "profile", "http://wretch.cc/user/foobar"],
+
["urlToGraphNode", "http://wretch.cc/user/foobar", "sgn://wretch.cc/?ident=foobar"],
+
["urlToGraphNode", "http://joseph.myplaxo.com", "sgn://plaxo.com/?ident=joseph"],
+
["urlToGraphNode", "http://www.plaxo.com/profile/showPublic/joseph", "sgn://plaxo.com/?ident=joseph"],
+
["urlToGraphNode", "http://www.plaxo.com/profile/showPublic/joseph/", "sgn://plaxo.com/?ident=joseph"],
+
["urlToGraphNode", "http://www.plaxo.com/profile/showPublic/joseph/1", "sgn://plaxo.com/?ident=joseph"],
+
["urlToGraphNode", "http://www.plaxo.com/profile/showPublic/JOSEPH", "sgn://plaxo.com/?ident=joseph"],
+
["urlToGraphNode", "http://www.plaxo.com/profile/show/joseph", "sgn://plaxo.com/?ident=joseph"],
+
["urlToGraphNode", "http://www.plaxo.com/profile/show/4294967299?pk=7b0da94f00ba0b53af9c52874fbe6fb1947763b7", "sgn://plaxo.com/?pk=4294967299"],
+
["urlFromGraphNode", "sgn://plaxo.com/?ident=joseph", "profile", "http://www.plaxo.com/profile/showPublic/joseph"],
+
["urlToGraphNode", "http://www.plaxo.com/profile/showPublic/joseph", "sgn://plaxo.com/?ident=joseph"],
+
["urlFromGraphNode", "sgn://plaxo.com/?ident=joseph", "rss", "http://www.plaxo.com/profile/publicRss/joseph"],
+
["urlToGraphNode", "http://www.plaxo.com/profile/publicRss/joseph", "sgn://plaxo.com/?ident=joseph"],
["pairToGraphNode", "spin.de", "Warp", "sgn://spin.de/?ident=warp"],

["urlToGraphNode", "http://www.spin.de/hp/Warp", "sgn://spin.de/?ident=warp"],

["urlToGraphNode", "http://www.spin.de/hp/warp", "sgn://spin.de/?ident=warp"],
=======================================
--- /trunk/sites/simple.js Wed Sep 1 18:33:22 2010
+++ /trunk/sites/simple.js Fri Sep 17 20:56:09 2010
@@ -26,6 +26,28 @@
nodemapper.addSimpleHandler("digg.com", "ident_to_rss",
"http://digg.com/users/", "/history/diggs.rss");

+nodemapper.registerDomain(
+ ["plaxo.com", "myplaxo.com"],
+ {name: "Plaxo",
+ primaryDomain: "plaxo.com",
+ identRegexp: /^[A-Za-z][\w\.-]*$/,
+ urlToGraphNode: nodemapper.createFirstMatchHandler([
+ nodemapper.createPathRegexpHandler(
+ "plaxo.com",
+ new RegExp("^/profile/show(?:Public)?/([A-Za-z][\\w.-]*)(?:/|
$|\\?)")),
+ nodemapper.createSomethingSlashUsernameHandler(
+ "profile/show(?:Public)?",
+ "plaxo.com",
+ {keyName: "pk"}),
+ nodemapper.createHostRegexpHandler(
+ "plaxo.com",
+ new RegExp("([\\w\\-]+)\." + "myplaxo.com" + "$", "i"))
+ ])});
+nodemapper.addSimpleHandler("plaxo.com", "ident_to_profile",
+ "http://www.plaxo.com/profile/showPublic/", "");
+nodemapper.addSimpleHandler("plaxo.com", "ident_to_rss",
+ "http://www.plaxo.com/profile/publicRss/", "");
+
nodemapper.registerDomain(
"pownce.com",
{name: "Pownce",
@@ -882,3 +904,13 @@
http://wretch.cc/user/FooBar/bogus
sgn://wretch.cc/?ident=foobar
http://wretch.cc/bogus/foobar
http://wretch.cc/bogus/foobar
profile(sgn://wretch.cc/?ident=foobar)
http://wretch.cc/user/foobar
+
+http://joseph.myplaxo.com sgn://plaxo.com/?ident=joseph
+http://www.plaxo.com/profile/showPublic/joseph
sgn://plaxo.com/?ident=joseph
+http://www.plaxo.com/profile/showPublic/joseph/
sgn://plaxo.com/?ident=joseph
+http://www.plaxo.com/profile/showPublic/joseph/1
sgn://plaxo.com/?ident=joseph
+http://www.plaxo.com/profile/showPublic/JOSEPH
sgn://plaxo.com/?ident=joseph
+http://www.plaxo.com/profile/show/joseph sgn://plaxo.com/?ident=joseph
+http://www.plaxo.com/profile/show/4294967299?pk=7b0da94f00ba0b53af9c52874fbe6fb1947763b7
sgn://plaxo.com/?pk=4294967299
+profile(sgn://plaxo.com/?ident=joseph)
http://www.plaxo.com/profile/showPublic/joseph
+rss(sgn://plaxo.com/?ident=joseph)
http://www.plaxo.com/profile/publicRss/joseph

Reply all
Reply to author
Forward
0 new messages