[google-sgnodemapper] r216 committed - Fix last.fm canonicaliztion for user URLs with a ? and no trailing /

1 view
Skip to first unread message

codesite...@google.com

unread,
Mar 3, 2010, 5:15:41 PM3/3/10
to sgnodemapp...@googlegroups.com
Revision: 216
Author: jsmarr
Date: Wed Mar 3 14:15:19 2010
Log: Fix last.fm canonicaliztion for user URLs with a ? and no trailing /

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

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

=======================================
--- /trunk/autogen/nodemapper.js Tue Feb 16 14:08:14 2010
+++ /trunk/autogen/nodemapper.js Wed Mar 3 14:15:19 2010
@@ -356,7 +356,8 @@
ret.push({
domain: domain,
name: handler.name,
- favIconUrl: handler.favIconUrl,
+ favIconUrl: handler.favIconUrl || '',
+ favIconUrlHttps: handler.favIconUrlHttps || '',
notMassMarketSite: nodemapper.handlers[domain].notMassMarketSite,
canGenerateFeedUrl: canGenerateFeedUrl
});
@@ -778,6 +779,7 @@
nodemapper.registerDomain("sidewiki.google.com", {
name: "Google Sidewiki",

favIconUrl: "http://www.google.com/sidewiki/intl/en/images/icon_yellowbubble.png",
+
favIconUrlHttps: "https://www.google.com/sidewiki/intl/en/images/icon_yellowbubble.png",
pkRegexp: /^\d{7,}$/,
identRegexp: /^[\w\.]{1,40}$/
});
@@ -870,7 +872,7 @@
"www.lastfm.se"
];
var lastFmHttpToSgn = nodemapper.createPathRegexpHandler(
- "last.fm", /^\/user\/([\w\-]+)(?:\/|$)/);
+ "last.fm", /^\/user\/([\w\-]+)(?:[\/?]|$)/);
nodemapper.registerDomain(
"last.fm",
{name: "Last.fm",
=======================================
--- /trunk/autogen/nodemapper_debug.js Tue Feb 16 14:08:14 2010
+++ /trunk/autogen/nodemapper_debug.js Wed Mar 3 14:15:19 2010
@@ -71,6 +71,8 @@
* @param {Object} handler Object with functions as properties:
* 'name': the display name for the domain.
* 'favIconUrl': URL to the favicon that represents the domain.
+ * 'favIconUrlHttps': URL to the favicon that works over HTTPS. If
possible
+ * this should be the same as favIconUrl except for the scheme.
* 'urlToGraphNode': function(url,host,path) -> ident/URL (more coming
* in the future). A handler deals with parsing a URL to an sgn://
* URL, and also mapping from sgn:// URLs back to different classes of
@@ -637,6 +639,7 @@
* name: "Site!"
* [, notMassMarketSite: 1]
* [, favIconUrl: "http://path.to.site/favicon.ico"]
+ * [, favIconUrlHttps: "https://path.to.site/favicon.ico"]
* },
* ... ]
*/
@@ -660,7 +663,8 @@
ret.push({
domain: domain,
name: handler.name,
- favIconUrl: handler.favIconUrl,
+ favIconUrl: handler.favIconUrl || '',
+ favIconUrlHttps: handler.favIconUrlHttps || '',
notMassMarketSite: nodemapper.handlers[domain].notMassMarketSite,
canGenerateFeedUrl: canGenerateFeedUrl
});
@@ -1214,6 +1218,7 @@
nodemapper.registerDomain("sidewiki.google.com", {
name: "Google Sidewiki",

favIconUrl: "http://www.google.com/sidewiki/intl/en/images/icon_yellowbubble.png",
+
favIconUrlHttps: "https://www.google.com/sidewiki/intl/en/images/icon_yellowbubble.png",
pkRegexp: /^\d{7,}$/,
identRegexp: /^[\w\.]{1,40}$/
});
@@ -1349,7 +1354,7 @@
];

var lastFmHttpToSgn = nodemapper.createPathRegexpHandler(
- "last.fm", /^\/user\/([\w\-]+)(?:\/|$)/);
+ "last.fm", /^\/user\/([\w\-]+)(?:[\/?]|$)/);

nodemapper.registerDomain(
"last.fm",
=======================================
--- /trunk/autogen/nodemapper_tests.js Tue Feb 16 14:08:14 2010
+++ /trunk/autogen/nodemapper_tests.js Wed Mar 3 14:15:19 2010
@@ -238,7 +238,10 @@

["urlToGraphNode", "http://www.last.fm/user/aa123", "sgn://last.fm/?ident=aa123"],

["urlToGraphNode", "http://lastfm.excite.co.jp/user/SomeCaps/", "sgn://last.fm/?ident=somecaps"],

["urlToGraphNode", "http://www.last.fm/user/after/addedevents/", "sgn://last.fm/?ident=after"],
+
["urlToGraphNode", "http://www.lastfm.pl/user/foo?setlang=pl", "sgn://last.fm/?ident=foo"],

["urlToGraphNode", "http://www.lastfm.pl/user/foo/?setlang=pl", "sgn://last.fm/?ident=foo"],
+
["urlToGraphNode", "http://www.lastfm.com.br/user/Steph-Tara", "sgn://last.fm/?ident=steph-tara"],
+
["urlToGraphNode", "http://www.lastfm.com.br/user/Steph-Tara?setlang=tr", "sgn://last.fm/?ident=steph-tara"],

["urlToGraphNode", "http://www.lastfm.com.br/user/Steph-Tara/?setlang=tr", "sgn://last.fm/?ident=steph-tara"],

["urlToGraphNode", "http://www.lastfm.com.tr/user/Steph-Tara/charts/?setlang=tr", "sgn://last.fm/?ident=steph-tara"],

["urlToGraphNode", "http://cn.last.fm/user/Steph-Tara/neighbours/", "sgn://last.fm/?ident=steph-tara"],
=======================================
--- /trunk/sites/lastfm.js Wed Apr 9 10:27:59 2008
+++ /trunk/sites/lastfm.js Wed Mar 3 14:15:19 2010
@@ -54,7 +54,7 @@
];

var lastFmHttpToSgn = nodemapper.createPathRegexpHandler(
- "last.fm", /^\/user\/([\w\-]+)(?:\/|$)/);
+ "last.fm", /^\/user\/([\w\-]+)(?:[\/?]|$)/);

nodemapper.registerDomain(
"last.fm",
@@ -74,8 +74,11 @@
http://www.last.fm/user/aa123 sgn://last.fm/?ident=aa123
http://lastfm.excite.co.jp/user/SomeCaps/ sgn://last.fm/?ident=somecaps
http://www.last.fm/user/after/addedevents/ sgn://last.fm/?ident=after
+http://www.lastfm.pl/user/foo?setlang=pl sgn://last.fm/?ident=foo
http://www.lastfm.pl/user/foo/?setlang=pl sgn://last.fm/?ident=foo

+http://www.lastfm.com.br/user/Steph-Tara sgn://last.fm/?ident=steph-tara
+http://www.lastfm.com.br/user/Steph-Tara?setlang=tr
sgn://last.fm/?ident=steph-tara
http://www.lastfm.com.br/user/Steph-Tara/?setlang=tr
sgn://last.fm/?ident=steph-tara
http://www.lastfm.com.tr/user/Steph-Tara/charts/?setlang=tr
sgn://last.fm/?ident=steph-tara
http://cn.last.fm/user/Steph-Tara/neighbours/
sgn://last.fm/?ident=steph-tara

Reply all
Reply to author
Forward
0 new messages