Skip to content

Commit

Permalink
New key user_is_subdomain determines request URI, add auto-updating.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabacab committed Apr 14, 2012
1 parent 547532f commit a7294b9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions eyes-of-arcadia.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
*/
// ==UserScript==
// @name Eyes of Arcadia
// @version 0.9.2.1
// @version 0.9.3
// @namespace http://maybemaimed.com/playground/eyes-of-arcadia/
// @updateURL https://userscripts.org/scripts/source/130861.user.js
// @description Automatically tests various social networks for user profiles whose names match the profile you're currently viewing. (Must be logged in to some networks for users on that network to be found. Not guaranteed to find the same human, but it works often.)
// @include http://www.okcupid.com/profile/*
// @include https://fetlife.com/users/*
Expand Down Expand Up @@ -51,6 +52,7 @@ ARCADIA.Networks.Tumblr = {
// See: http://www.tumblr.com/docs/en/api/v2
'profile_url_match': 'tumblr.com',
'profile_url_api' : 'http://', // the API here is just the domain name
'user_is_subdomain': true,
'http_request_method': 'HEAD',
'successFunction': function (response) {
ARCADIA.log('executing Tumblr.successFunction()');
Expand Down Expand Up @@ -100,6 +102,7 @@ ARCADIA.Networks.Tumblr = {
ARCADIA.Networks.WordPress = {
'profile_url_match': 'wordpress.com',
'profile_url_api' : 'https://public-api.wordpress.com/rest/v1/sites/',
'user_is_subdomain': true,
'http_request_method': 'GET',
'successFunction': function (response) {
ARCADIA.log('executing WordPress.successFunction()');
Expand Down Expand Up @@ -373,8 +376,8 @@ ARCADIA.main = function () {
continue;
}
var request_uri = this.Networks[k].profile_url_api + this.nickname;
// WordPress and Tumblr searches happen by domain, so take care.
if ('WordPress' === k || 'Tumblr' === k) {
// Some services, like WordPress & Tumblr, treat subdomains as user IDs.
if (this.Networks[k].user_is_subdomain) {
request_uri += '.' + this.Networks[k].profile_url_match;
}
GM_xmlhttpRequest({
Expand Down

0 comments on commit a7294b9

Please sign in to comment.