Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cleaning copied Twitter URLs #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cleaning_rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ const instagram_regexp = [
];

const twitter_regexp = [
"*://*.twitter.com/*"
"*://*.twitter.com/*",
"*://twitter.com/*",
]

// query params matching used in link_cleaner()
Expand Down
1 change: 1 addition & 0 deletions copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ function cleaner_entrypoint (orig_link) {
new_link = maybe_clean(new_link, aliexpress_regexp, f_match_all);
new_link = maybe_clean(new_link, fbcontent_regexp, f_match_fbcontent);
new_link = maybe_clean(new_link, instagram_regexp, f_match_igshid);
new_link = maybe_clean(new_link, twitter_regexp, t_match_s_or_t);

// 3rd check: (optional) clean Amazon URL
if (settings['clean_amp_links'] === true) {
Expand Down
3 changes: 3 additions & 0 deletions test_urls.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ <h1>Test page</h1>
<br /><br />
<a href="https://twitter.com/jack/status/20?s=20&t=_x-3XahP6TiTu_0lDkcEig">twitter shared tweet</a>

<br /><br />
<a href="https://www.twitter.com/jack/status/20?s=20&t=_x-3XahP6TiTu_0lDkcEig">twitter shared tweet (www)</a>

<br /><br />
paste cleaned link here:<br />
<textarea cols=80 rows=10></textarea>
4 changes: 3 additions & 1 deletion test_urls.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ https://medium.com/m/global-identity?redirectUrl=https://blog.unocoin.com/how-tr

https://jsv3.recruitics.com/redirect?rx_cid=3308&rx_jobId=R181269&rx_url=https%3A//careers.arrow.com/us/en/job/R181269/Accounting-Consolidations-Reporting-Analyst-II%3Futm_medium%3Dphenom-feeds%26utm_source%3Dbuiltincolorado%26rx_medium%3Dpost%26rx_paid%3D1%26rx_r%3Dnone%26rx_source%3Dbuiltinco%26rx_ts%3D20201116T192433Z

https://twitter.com/jack/status/20?s=20&t=_x-3XahP6TiTu_0lDkcEig
https://twitter.com/jack/status/20?s=20&t=_x-3XahP6TiTu_0lDkcEig

https://www.twitter.com/jack/status/20?s=20&t=_x-3XahP6TiTu_0lDkcEig