[google-sgnodemapper] r237 committed - adding wretch.cc to simple.js -- I am submitting this code change on b...

1 view
Skip to first unread message

codesite...@google.com

unread,
Sep 1, 2010, 9:33:56 PM9/1/10
to sgnodemapp...@googlegroups.com
Revision: 237
Author: neilfred
Date: Wed Sep 1 18:33:22 2010
Log: adding wretch.cc to simple.js -- I am submitting this code change on
behalf of clai...@google.com

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

Modified:
/trunk/sites/simple.js

=======================================
--- /trunk/sites/simple.js Tue Aug 24 12:17:37 2010
+++ /trunk/sites/simple.js Wed Sep 1 18:33:22 2010
@@ -550,6 +550,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__

http://digg.com/users/foobar sgn://digg.com/?ident=foobar
@@ -846,3 +868,17 @@
http://foursquare.com/user/-123456789/ sgn://foursquare.com/?pk=123456789
http://foursquare.com/user/-123456789?mode=foo
sgn://foursquare.com/?pk=123456789
profile(sgn://foursquare.com/?pk=987654321)
http://foursquare.com/user/-987654321
+
+http://wretch.cc/user/foobar
sgn://wretch.cc/?ident=foobar
+http://wretch.cc/blog/foobar
sgn://wretch.cc/?ident=foobar
+http://wretch.cc/blog/foobar/12345
sgn://wretch.cc/?ident=foobar
+http://wretch.cc/blog/foobar&commentsRss20=1
sgn://wretch.cc/?ident=foobar
+http://www.wretch.cc/user/profile.php?id=foobar
sgn://wretch.cc/?ident=foobar
+http://www.wretch.cc/blog/blog.php?id=foobar
sgn://wretch.cc/?ident=foobar
+http://www.wretch.cc/album/album_rss.php?id=foobar
sgn://wretch.cc/?ident=foobar
+http://wretch.cc/user/FooBar
sgn://wretch.cc/?ident=foobar
+http://wretch.cc/user/Foo.Bar
sgn://wretch.cc/?ident=foo.bar
+http://wretch.cc/user/Foobar?bogus
sgn://wretch.cc/?ident=foobar
+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

Reply all
Reply to author
Forward
0 new messages