Facebook outlink demangler
Type in a Facebook outlink here:
What is this?
This is a little tool for demangling Facebook outlinks. Instead of clicking on an outlink, which takes you through an intermediate tracking page, you can copy the outlink URL (right-click and 'Copy Link Location' in Firefox), and put it into this form. It will give you a URL that you can use to directly go to the site that you wanted, bypassing the tracker.
I explain briefly here why why this practice may be desirable.
Source code for this page
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Facebook outlink demangler</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
</head>
<body>
<div id = "content">
<h1>Facebook outlink demangler</h1>
<?php
if (!is_null($_REQUEST["outlink"]))
{
$outlink = $_REQUEST["outlink"];
$demangled = preg_replace("/.*u=(.*?)&.*/", "$1", $outlink);
$demangled = urldecode($demangled);
$demangled = preg_replace("/fbclid=[A-Za-z0-9]*/", "", $demangled);
$demangled_noparams = preg_replace("/\?.*/", "", $demangled);
?>
<p>Your mangled Facebook outlink was:<br/>
<tt>
<?= $outlink ?>
</tt>
<p>It has been demangled to:<br/>
<tt>
<a href="<?=$demangled?>" target="_blank"><?= $demangled ?></a>
<?=var_dump($demangled)?>
</tt>
</p>
<p>
Or, without request parameters:<br/>
<tt>
<a href="<?=$demangled_noparams?>" target="_blank"><?= $demangled_noparams ?></a><br/>
<?=var_dump($demangled_noparams)?>
</tt>
</p>
<?}?>
<p>Type in a Facebook outlink here:</p>
<form action="<?=$_SERVER['REQUEST_URI']?>" method="post"
style="padding-right:20px">
<input type="text" name="outlink" style="width:100%; "/><br/>
<input type="submit" value="Demangle"/>
</form>
<h2>What is this?</h2>
<p>
This is a little tool for demangling Facebook outlinks. Instead of clicking on
an outlink, which takes you through an intermediate tracking page, you can copy
the outlink URL (right-click and 'Copy Link Location' in Firefox), and put it
into this form. It will give you a URL that you can use to directly go to the
site that you wanted, bypassing the tracker.
</p>
<p>I explain briefly
<a href="/2017/06/01/some-privacy-practices-when-using-facebook/">here</a> why
why this practice may be desirable.</p>
<p><a href="mailto:jmft2@cam.ac.uk">Email me</a></p>
<p><a href="..">Home</a></p>
<h2>Source code for this page</h2>
<!-- <div style="margin-left:1in; margin-right:1in; border:groove; padding: 10px"> -->
<div style="margin-left:10px; margin-right:10px; border:groove; padding: 10px">
<?php
highlight_file("facebook-outlink-demangler.php");
?>
</div>
</div>
<div id="footer">
<p><a href="/">home</a></p>
<p id="date">Last updated 7 November 2017.</p>
<p id="author">jmft2 at cam dot ac dot uk</p>
<p style="margin: 0;">
<a href="http://validator.w3.org/check?uri=referer"><img
src="http://www.w3.org/Icons/valid-xhtml11" alt="Valid XHTML 1.1" height="31" width="88" /></a>
</p>
</div> <!-- footer -->
</body>
</html>