From 8dfec5894592388488d6a10e6f397ab8f1a90cad Mon Sep 17 00:00:00 2001 From: blackmatrix7 <27717518+blackmatrix7@users.noreply.github.com> Date: Wed, 8 Feb 2023 17:27:19 +0800 Subject: [PATCH] [Quora] Remove Ads --- script/quora/README.md | 26 +++++++++++++++++ script/quora/quora.lnplugin | 25 +++++++++++++++++ script/quora/quora.sgmodule | 21 ++++++++++++++ script/quora/quora.snippet | 17 +++++++++++ script/quora/quora.stoverride | 53 +++++++++++++++++++++++++++++++++++ 5 files changed, 142 insertions(+) create mode 100644 script/quora/README.md create mode 100644 script/quora/quora.lnplugin create mode 100644 script/quora/quora.sgmodule create mode 100644 script/quora/quora.snippet create mode 100644 script/quora/quora.stoverride diff --git a/script/quora/README.md b/script/quora/README.md new file mode 100644 index 000000000..ed01eb530 --- /dev/null +++ b/script/quora/README.md @@ -0,0 +1,26 @@ +# Quora + +## Surge + +```ini +https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/quora/quora.sgmodule +``` + +## Quantumult X + +```ini +https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/quora/quora.snippet +``` + +## Loon + +```ini +https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/quora/quora.lnplugin +``` + +## Stash + +```ini +https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/script/quora/quora.stoverride +``` + diff --git a/script/quora/quora.lnplugin b/script/quora/quora.lnplugin new file mode 100644 index 000000000..2c270a7df --- /dev/null +++ b/script/quora/quora.lnplugin @@ -0,0 +1,25 @@ +#!name=Quora +#!desc=Quora Remove Ads +#!openUrl=https://github.com/blackmatrix7/ios_rule_script/script/quora +#!author=blackmatrix7 +#!homepage=https://github.com/blackmatrix7/ios_rule_script +#!icon=https://git.codecolor.cool/matrix/script/raw/branch/master/quora/quora.png + +[URL Rewrite] +# 去除回答列表中展开内容的广告 +^https:\/\/www\.quora\.com\/graphql\/gql_para_POST\?q=AnswerExpandAdLoaderQuery - reject + +[Script] +# 去除首页广告 +http-response ^https:\/\/www\.quora\.com\/(graphql\/gql_para_POST\?q=MultifeedQuery)?$ requires-body=1,script-path=https://gist.githubusercontent.com/blackmatrix7/7775186471b181e5ad472156ca3c206f/raw/quora.min.js,tag=Quora RemoveHomePageAd +# 去除回答内容的广告 +http-response ^https:\/\/www\.quora\.com\/graphql\/gql_para_POST\?q=AnswerPageFooterLoaderQuery requires-body=1,script-path=https://gist.githubusercontent.com/blackmatrix7/7775186471b181e5ad472156ca3c206f/raw/quora.min.js,tag=Quora RemoveAnswerPageAd +# 去除回答列表的广告 +http-response ^https:\/\/www\.quora\.com\/graphql\/gql_para_POST\?q=(QuestionAnswerPagedListQuery|QuestionPageLoadableBodyQuery) requires-body=1,script-path=https://gist.githubusercontent.com/blackmatrix7/7775186471b181e5ad472156ca3c206f/raw/quora.min.js,tag=Quora RemoveAnswerPageListAd +# 去除从回答底部进入的回答列表的广告 +http-response ^https:\/\/www\.quora.com\/.*-.* requires-body=1,script-path=https://gist.githubusercontent.com/blackmatrix7/7775186471b181e5ad472156ca3c206f/raw/quora.min.js,tag=Quora RemoveAnswerPageOtherListAd +# 去除文章底部的广告 +http-response ^https:\/\/www\.quora\.com\/graphql\/gql_para_POST\?q=PostPageFooterLoaderQuery requires-body=1,script-path=https://gist.githubusercontent.com/blackmatrix7/7775186471b181e5ad472156ca3c206f/raw/quora.min.js,tag=Quora RemovePostPageFooterAd + +[MITM] +hostname = www.quora.com \ No newline at end of file diff --git a/script/quora/quora.sgmodule b/script/quora/quora.sgmodule new file mode 100644 index 000000000..44b904887 --- /dev/null +++ b/script/quora/quora.sgmodule @@ -0,0 +1,21 @@ +#!name=Quora +#!desc=Quora Remove Ads + +[URL Rewrite] +# 去除回答列表中展开内容的广告 +^https:\/\/www\.quora\.com\/graphql\/gql_para_POST\?q=AnswerExpandAdLoaderQuery - reject + +[Script] +# 去除首页广告 +Quora RemoveHomePageAd = type=http-response,pattern=^https:\/\/www\.quora\.com\/(graphql\/gql_para_POST\?q=MultifeedQuery)?$,requires-body=1,max-size=0,script-path=https://gist.githubusercontent.com/blackmatrix7/7775186471b181e5ad472156ca3c206f/raw/quora.min.js,script-update-interval=86400 +# 去除回答内容的广告 +Quora RemoveAnswerPageAd = type=http-response,pattern=^https:\/\/www\.quora\.com\/graphql\/gql_para_POST\?q=AnswerPageFooterLoaderQuery,requires-body=1,max-size=0,script-path=https://gist.githubusercontent.com/blackmatrix7/7775186471b181e5ad472156ca3c206f/raw/quora.min.js,script-update-interval=86400 +# 去除回答列表的广告 +Quora RemoveAnswerPageListAd = type=http-response,pattern=^https:\/\/www\.quora\.com\/graphql\/gql_para_POST\?q=(QuestionAnswerPagedListQuery|QuestionPageLoadableBodyQuery),requires-body=1,max-size=0,script-path=https://gist.githubusercontent.com/blackmatrix7/7775186471b181e5ad472156ca3c206f/raw/quora.min.js,script-update-interval=86400 +# 去除从回答底部进入的回答列表的广告 +Quora RemoveAnswerPageOtherListAd = type=http-response,pattern=^https:\/\/www\.quora.com\/.*-.*,requires-body=1,max-size=0,script-path=https://gist.githubusercontent.com/blackmatrix7/7775186471b181e5ad472156ca3c206f/raw/quora.min.js,script-update-interval=86400 +# 去除文章底部的广告 +Quora RemovePostPageFooterAd = type=http-response,pattern=^https:\/\/www\.quora\.com\/graphql\/gql_para_POST\?q=PostPageFooterLoaderQuery,requires-body=1,max-size=0,script-path=https://gist.githubusercontent.com/blackmatrix7/7775186471b181e5ad472156ca3c206f/raw/quora.min.js,script-update-interval=86400 + +[MITM] +hostname = %APPEND% www.quora.com \ No newline at end of file diff --git a/script/quora/quora.snippet b/script/quora/quora.snippet new file mode 100644 index 000000000..e87cd90a7 --- /dev/null +++ b/script/quora/quora.snippet @@ -0,0 +1,17 @@ +# Quora +# Quora Remove Ads + +# 去除回答列表中展开内容的广告 +^https:\/\/www\.quora\.com\/graphql\/gql_para_POST\?q=AnswerExpandAdLoaderQuery url reject +# 去除首页广告 +^https:\/\/www\.quora\.com\/(graphql\/gql_para_POST\?q=MultifeedQuery)?$ url script-response-body https://gist.githubusercontent.com/blackmatrix7/7775186471b181e5ad472156ca3c206f/raw/quora.min.js +# 去除回答内容的广告 +^https:\/\/www\.quora\.com\/graphql\/gql_para_POST\?q=AnswerPageFooterLoaderQuery url script-response-body https://gist.githubusercontent.com/blackmatrix7/7775186471b181e5ad472156ca3c206f/raw/quora.min.js +# 去除回答列表的广告 +^https:\/\/www\.quora\.com\/graphql\/gql_para_POST\?q=(QuestionAnswerPagedListQuery|QuestionPageLoadableBodyQuery) url script-response-body https://gist.githubusercontent.com/blackmatrix7/7775186471b181e5ad472156ca3c206f/raw/quora.min.js +# 去除从回答底部进入的回答列表的广告 +^https:\/\/www\.quora.com\/.*-.* url script-response-body https://gist.githubusercontent.com/blackmatrix7/7775186471b181e5ad472156ca3c206f/raw/quora.min.js +# 去除文章底部的广告 +^https:\/\/www\.quora\.com\/graphql\/gql_para_POST\?q=PostPageFooterLoaderQuery url script-response-body https://gist.githubusercontent.com/blackmatrix7/7775186471b181e5ad472156ca3c206f/raw/quora.min.js + +hostname = www.quora.com \ No newline at end of file diff --git a/script/quora/quora.stoverride b/script/quora/quora.stoverride new file mode 100644 index 000000000..a469d8ae7 --- /dev/null +++ b/script/quora/quora.stoverride @@ -0,0 +1,53 @@ +name: Quora +desc: Quora Remove Ads + +http: + rewrite: + # 去除回答列表中展开内容的广告 + - ^https:\/\/www\.quora\.com\/graphql\/gql_para_POST\?q=AnswerExpandAdLoaderQuery - reject + + script: + # 去除首页广告 + - match: ^https:\/\/www\.quora\.com\/(graphql\/gql_para_POST\?q=MultifeedQuery)?$ + name: quora.js + type: response + require-body: true + timeout: 30 + argument: '' + + # 去除回答内容的广告 + - match: ^https:\/\/www\.quora\.com\/graphql\/gql_para_POST\?q=AnswerPageFooterLoaderQuery + name: quora.js + type: request + require-body: true + timeout: 30 + argument: '' + + # 去除回答列表的广告 + - match: ^https:\/\/www\.quora\.com\/graphql\/gql_para_POST\?q=(QuestionAnswerPagedListQuery|QuestionPageLoadableBodyQuery) + name: quora.js + type: response + require-body: true + timeout: 30 + argument: '' + + # 去除从回答底部进入的回答列表的广告 + - match: ^https:\/\/www\.quora.com\/.*-.* + name: quora.js + type: response + require-body: true + timeout: 30 + argument: '' + + # 去除文章底部的广告 + - match: ^https:\/\/www\.quora\.com\/graphql\/gql_para_POST\?q=PostPageFooterLoaderQuery + name: quora.js + type: response + require-body: true + timeout: 30 + argument: '' + +script-providers: + quora.js: + url: https://gist.githubusercontent.com/blackmatrix7/7775186471b181e5ad472156ca3c206f/raw/quora.min.js + interval: 86400 \ No newline at end of file