n

t.co to random nitter instance redirector
git clone https://xfnw.ttm.sh/git/n.git
Log | Files | Refs

index.php (618B)


      1 <?php
      2 
      3 $instances = Array('nitter.eu','nitter.fdn.fr','nitter.tedomum.net');
      4 
      5 $instance = $instances[array_rand($instances)];
      6 
      7 //echo $instance;
      8 
      9 $path = key($_GET); // just take the entire query str lol
     10 
     11 $headers = @get_headers('https://t.co/'.$path,1);
     12 
     13 //print_r($headers);
     14 
     15 if (isset($headers['location'])) {
     16 	$url = str_replace('https://twitter.com/','https://'.$instance.'/',$headers['location']);
     17 	header('Location: '.$url);
     18 } else {
     19 ?>
     20 <h1>t.co nitter converter</h1>
     21 t.co/honk -> xfnw.ttm.sh/n?honk -> some.nitter.instance/expanded/url
     22 <br><br>
     23 <a href="https://xfnw.ttm.sh/git/n/log.html">source</a>
     24 <?php
     25 }
     26