View Single Post
  #1524  
Old 24.08.2020, 12:30
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,000
Default

Quote:
Originally Posted by DeusExBestia View Post
... script that will replace any twitter links that contain "/status/NumbersHere" with "/media." ...
Code:
/*
    Rewrite URL
    Trigger: New Crawler Job
*/

var re = /(https:\/\/twitter.com\/[^\/]+\/)(status\/\d+)/g;
var text = job.text;

if (re.test(text)) {
    job.text = job.text.replace(re, "$1media");
}
Reply With Quote