Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1.) PHP script below
- 2.) Apache redirect lines below
- 3.) Make custom search in Brave/Chrome called "nit" with this: https://www.YOURDOMAIN.com/nitter/nitter.1d4.us/%s
- To use: tab nit TWEET
- To use: tab nit TWITTERACCOUNT
- Note: The nitter instance can be anything you want, change in above main custom search line
- 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.
- PHP---------------------------------------
- <?php
- $breakme=0;
- if(isset($_GET['server'])){
- $server=$_GET['server'];
- }
- else
- {
- $server='ANYSERVERYOUWANT';
- }
- if(isset($_GET['incoming'])){
- $incoming=$_GET['incoming'];
- $stringCompiler=$incoming;
- }
- else
- {
- echo("You didn't include a twitter url to flip.");
- $breakme=1;
- }
- if($stringCompiler==''){
- echo('<br /><br />$stringcompiler doesnt have a value. Breaking out. Nothing done.');
- $breakme=1;
- }
- echo '<br />Server is: '.$server;
- echo '<br />Incoming is: '.$incoming;
- if($breakme!==1){
- // which means 'do it' else a quick error message has already been printed to screen
- header('Location: https://'.$server.'/'.$stringCompiler);
- };
- ?>
- / PHP---------------------------------------
- APACHE---------------------------------------------
- RewriteRule ^/nitter/(.*?)(?:\/http.*?)\/(?:twit.*\/)(.*\/status\/.*) /var/www/html/scripts/nitter_$
- RewriteRule ^/nitter/(.*?)\/(\w+$) /var/www/html/scripts/nitter_flipper.php?server=$1&incoming=$2 [$
- /APACHE---------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement