Advertisement
commandlinekid

Nitter Custom Search for Chrome or Brave Browser

Mar 15th, 2023 (edited)
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. 1.) PHP script below
  2. 2.) Apache redirect lines below
  3. 3.) Make custom search in Brave/Chrome called "nit" with this: https://www.YOURDOMAIN.com/nitter/nitter.1d4.us/%s
  4. To use: tab nit TWEET
  5. To use: tab nit TWITTERACCOUNT
  6. Note: The nitter instance can be anything you want, change in above main custom search line
  7. Note: This is sloppier than sloppy. All the regex should be done in the PHP and the regex should be written much better but it works and I did it at lunch time without thinking much using a script I already had.
  8.  
  9. PHP---------------------------------------
  10. <?php
  11. $breakme=0;
  12. if(isset($_GET['server'])){
  13. $server=$_GET['server'];
  14. }
  15. else
  16. {
  17. $server='ANYSERVERYOUWANT';
  18. }
  19.  
  20. if(isset($_GET['incoming'])){
  21. $incoming=$_GET['incoming'];
  22. $stringCompiler=$incoming;
  23. }
  24. else
  25. {
  26. echo("You didn't include a twitter url to flip.");
  27. $breakme=1;
  28. }
  29.  
  30. if($stringCompiler==''){
  31. echo('<br /><br />$stringcompiler doesnt have a value. Breaking out. Nothing done.');
  32. $breakme=1;
  33. }
  34. echo '<br />Server is: '.$server;
  35. echo '<br />Incoming is: '.$incoming;
  36. if($breakme!==1){
  37. // which means 'do it' else a quick error message has already been printed to screen
  38.  
  39. header('Location: https://'.$server.'/'.$stringCompiler);
  40.  
  41. };
  42.  
  43. ?>
  44. / PHP---------------------------------------
  45.  
  46. APACHE---------------------------------------------
  47. RewriteRule ^/nitter/(.*?)(?:\/http.*?)\/(?:twit.*\/)(.*\/status\/.*) /var/www/html/scripts/nitter_$
  48. RewriteRule ^/nitter/(.*?)\/(\w+$) /var/www/html/scripts/nitter_flipper.php?server=$1&incoming=$2 [$
  49. /APACHE---------------------------------------------
Tags: twitter nitter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement