Collection of mostly command line tools / PHP scripts. Somewhat out of date.

⌈⌋ ⎇ branch:  scripts + snippets


Artifact [cea8fad7d1]

Artifact cea8fad7d1ee65ecea6b38c7013327a0d6bb3d1c:

  • File social-media-links/social.img.php — part of check-in [c49ea11126] at 2014-12-13 17:36:28 on branch trunk — Retrieve count of backlinks to URL from various web services (Facebook, Google+, Twitter, Reddit, StumbleUpon, LinkedIn, Delicious, Pinterest) <em>Shallow merge of previous <code>php-scripts.fossil</code> repo.</em> (user: mario size: 628)

<?php
/**
 * description: Generates an image from the cumulative social media backlinks count
 *
 */


#-- retrieve
include("./social.count.php");
$url = @$_GET["url"];
if (filter_var($url, FILTER_VALIDATE_URL)) {
   $num = cache_fn("social_links_count", $url);
   $total = array_sum($num);
}
else {
   $total = "no url given";
}

#-- create PNG
$png = imagecreate(6 + 9 * strlen($total), 20);
$bg = imagecolorallocate($png, 255, 255, 255);
$fg = imagecolorallocate($png, 55, 55, 55);
imagestring($png, 5, 3, 2, "$total", $fg);

#-- output
header("Content-Type: image/png; version=1.2");
imagepng($png);
imagedestroy($png);


?>