Skip to content

Commit

Permalink
More websites/rules
Browse files Browse the repository at this point in the history
  • Loading branch information
qsniyg committed Aug 13, 2024
1 parent 2ef7182 commit 9d9c27e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
19 changes: 14 additions & 5 deletions src/userscript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30640,7 +30640,8 @@ var $$IMU_EXPORT$$;
if (newsrc) return newsrc;
}

if (domain_nowww === "twitter.com") {
if (domain_nowww === "twitter.com" ||
domain_nowww === "x.com") {
// https://github.com/qsniyg/maxurl/issues/243
// https://twitter.com/NoMansSky/status/1325458262800683009
var _query_twitter_webapi = function(url, cookies, cb) {
Expand Down Expand Up @@ -30690,7 +30691,7 @@ var $$IMU_EXPORT$$;

var query_twitter_webapi = function(url, cb) {
if (options.get_cookies) {
options.get_cookies("https://www.twitter.com/", function(cookies) {
options.get_cookies("https://www.x.com/", function(cookies) {
if (cookies) cookies = headers_list_to_dict(cookies);
_query_twitter_webapi(url, cookies, cb);
});
Expand Down Expand Up @@ -30762,7 +30763,7 @@ var $$IMU_EXPORT$$;
if (users && tweet.id_str && tweet.user_id_str) {
var username = users[tweet.user_id_str].screen_name;
obj.extra.author_username = username;
obj.extra.page = "https://twitter.com/" + username + "/status/" + tweet.id_str;
obj.extra.page = "https://x.com/" + username + "/status/" + tweet.id_str;
}

if (tweet.full_text) {
Expand Down Expand Up @@ -30968,7 +30969,7 @@ var $$IMU_EXPORT$$;
if (newsrc) return newsrc;
}

if (host_domain_nowww === "twitter.com" && options.element) {
if ((host_domain_nowww === "twitter.com" || host_domain_nowww === "x.com") && options.element) {
var tweet_link = common_functions["get_twitter_tweet_link"](options.element);

page_nullobj = null;
Expand Down Expand Up @@ -33205,6 +33206,9 @@ var $$IMU_EXPORT$$;
// thanks to James Joint on discord:
// https://images.kerrangcdn.com/images/2023/05/NessaBarrett-JamieLeeTaete-2023-9.jpg?auto=compress&fit=max&w=640
domain === "images.kerrangcdn.com" ||
// thanks to anonymous for reporting:
// https://cso.org/media/ls1fzrky/kelliohara_1500x1125_v2.jpg?anchor=center&mode=crop&width=1440&height=795&format=jpg&quality=85&rnd=132965911799130000
(domain_nowww === "cso.org" && /\/media\//.test(src)) ||
// http://us.jimmychoo.com/dw/image/v2/AAWE_PRD/on/demandware.static/-/Sites-jch-master-product-catalog/default/dw70b1ebd2/images/rollover/LIZ100MPY_120004_MODEL.jpg?sw=245&sh=245&sm=fit
// https://www.aritzia.com/on/demandware.static/-/Library-Sites-Aritzia_Shared/default/dw3a7fef87/seasonal/ss18/ss18-springsummercampaign/ss18-springsummercampaign-homepage/hptiles/tile-wilfred-lrg.jpg
src.match(/\/demandware\.static\//) ||
Expand Down Expand Up @@ -34213,6 +34217,10 @@ var $$IMU_EXPORT$$;
}

if ((domain === "store.pinseyun.com" && string_indexof(src, "/uploads/") >= 0) ||
// thanks to anonymous for reporting:
// https://s3.manualzz.com/store/data/019683962_1-63c5f7e3eec5b6a39772d3cb21b7e749-360x466.png
// https://s3.manualzz.com/store/data/019683962_1-63c5f7e3eec5b6a39772d3cb21b7e749.png
(domain === "s3.manualzz.com" && /\/store\/+data\//.test(src)) ||
// https://media.coindesk.com/uploads/2018/07/shutterstock_703755544-860x430.jpg
(domain === "media.coindesk.com" && string_indexof(src, "/uploads/") >= 0)) {
// http://store.pinseyun.com/uploads/2016/10/20161021222440-150x150.jpg
Expand Down Expand Up @@ -117811,7 +117819,8 @@ var $$IMU_EXPORT$$;
};
}

if (host_domain_nowww === "twitter.com") {
if (host_domain_nowww === "twitter.com" ||
host_domain_nowww === "x.com") {
return {
gallery: function(el, nextprev) {
var is_photo_a = function(el) {
Expand Down
19 changes: 14 additions & 5 deletions userscript.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -27962,7 +27962,8 @@ var $$IMU_EXPORT$$;
if (newsrc)
return newsrc;
}
if (domain_nowww === "twitter.com") {
if (domain_nowww === "twitter.com" ||
domain_nowww === "x.com") {
// https://github.com/qsniyg/maxurl/issues/243
// https://twitter.com/NoMansSky/status/1325458262800683009
var _query_twitter_webapi = function(url, cookies, cb) {
Expand Down Expand Up @@ -28008,7 +28009,7 @@ var $$IMU_EXPORT$$;
};
var query_twitter_webapi = function(url, cb) {
if (options.get_cookies) {
options.get_cookies("https://www.twitter.com/", function(cookies) {
options.get_cookies("https://www.x.com/", function(cookies) {
if (cookies)
cookies = headers_list_to_dict(cookies);
_query_twitter_webapi(url, cookies, cb);
Expand Down Expand Up @@ -28074,7 +28075,7 @@ var $$IMU_EXPORT$$;
if (users && tweet.id_str && tweet.user_id_str) {
var username = users[tweet.user_id_str].screen_name;
obj.extra.author_username = username;
obj.extra.page = "https://twitter.com/" + username + "/status/" + tweet.id_str;
obj.extra.page = "https://x.com/" + username + "/status/" + tweet.id_str;
}
if (tweet.full_text) {
obj.extra.caption = tweet.full_text;
Expand Down Expand Up @@ -28245,7 +28246,7 @@ var $$IMU_EXPORT$$;
if (newsrc)
return newsrc;
}
if (host_domain_nowww === "twitter.com" && options.element) {
if ((host_domain_nowww === "twitter.com" || host_domain_nowww === "x.com") && options.element) {
var tweet_link = common_functions["get_twitter_tweet_link"](options.element);
page_nullobj = null;
if (tweet_link) {
Expand Down Expand Up @@ -30353,6 +30354,9 @@ var $$IMU_EXPORT$$;
// thanks to James Joint on discord:
// https://images.kerrangcdn.com/images/2023/05/NessaBarrett-JamieLeeTaete-2023-9.jpg?auto=compress&fit=max&w=640
domain === "images.kerrangcdn.com" ||
// thanks to anonymous for reporting:
// https://cso.org/media/ls1fzrky/kelliohara_1500x1125_v2.jpg?anchor=center&mode=crop&width=1440&height=795&format=jpg&quality=85&rnd=132965911799130000
(domain_nowww === "cso.org" && /\/media\//.test(src)) ||
// http://us.jimmychoo.com/dw/image/v2/AAWE_PRD/on/demandware.static/-/Sites-jch-master-product-catalog/default/dw70b1ebd2/images/rollover/LIZ100MPY_120004_MODEL.jpg?sw=245&sh=245&sm=fit
// https://www.aritzia.com/on/demandware.static/-/Library-Sites-Aritzia_Shared/default/dw3a7fef87/seasonal/ss18/ss18-springsummercampaign/ss18-springsummercampaign-homepage/hptiles/tile-wilfred-lrg.jpg
src.match(/\/demandware\.static\//) ||
Expand Down Expand Up @@ -31350,6 +31354,10 @@ var $$IMU_EXPORT$$;
src = src.replace(/-[0-9]+x[0-9]+\.([^/]*(?:[?#].*)?)$/, ".$1");
}
if ((domain === "store.pinseyun.com" && string_indexof(src, "/uploads/") >= 0) ||
// thanks to anonymous for reporting:
// https://s3.manualzz.com/store/data/019683962_1-63c5f7e3eec5b6a39772d3cb21b7e749-360x466.png
// https://s3.manualzz.com/store/data/019683962_1-63c5f7e3eec5b6a39772d3cb21b7e749.png
(domain === "s3.manualzz.com" && /\/store\/+data\//.test(src)) ||
// https://media.coindesk.com/uploads/2018/07/shutterstock_703755544-860x430.jpg
(domain === "media.coindesk.com" && string_indexof(src, "/uploads/") >= 0)) {
// http://store.pinseyun.com/uploads/2016/10/20161021222440-150x150.jpg
Expand Down Expand Up @@ -105631,7 +105639,8 @@ var $$IMU_EXPORT$$;
}
};
}
if (host_domain_nowww === "twitter.com") {
if (host_domain_nowww === "twitter.com" ||
host_domain_nowww === "x.com") {
return {
gallery: function(el, nextprev) {
var is_photo_a = function(el) {
Expand Down

0 comments on commit 9d9c27e

Please sign in to comment.