How to Print Picture Filenames by Tag in Shotwell

Following through with one of my goals for 2016 — to contribute to open source, I have been publishing a lot of my code on github. Today I reported bug and sent a pull request with a bugfix to gnomato. On this post, I will share a quick script that I wrote last week that will print the filenames for all the photos given a specific tagname in Shotwell. Continue reading “How to Print Picture Filenames by Tag in Shotwell” »

Script for Estafeta package tracking using a tracking code

Are you looking to track your package sent via estafeta in mexico? This shell script will help you do that without using your web browser. Example:

[amado@localhost ~]$ ~/bin/ 99999
Localisando el # de guia: 99999

   04/11/2012 08:37 PM
   Guadalajara Llegada a centro de distribución GDL Guadalajara

   04/11/2012 08:44 PM
   Guadalajara En ruta foránea hacia REX-Reynosa

   Versión 3.2

Continue reading “Script for Estafeta package tracking using a tracking code” »

Download a whole youtube playlist to your computer in php.

I don’t know if I should be sharing this code snippet, but this is just too cool!

  1. Get the code from the links on this page:
  2. Append this hack at the bottom of the php code:
$watch_ids	=	array();
$url = "";
$plyst	=	file_get_contents("");
$matchall	=	preg_match_all('/<li class="playlist-video-item[^>]+>([\s\S]*?)<\/li>/', $plyst, $matches);

$info		=	preg_match_all('/<span class="title video-title "[^>]+>([^<]+)/', $plyst, $desc);

#var_dump($desc, $matches);exit;
for($i = 0; $i < $matchall ; $i++)
  preg_match('/watch\?v=([a-zA-Z0-9]+)/', $matches[1][$i], $id);
  $id	=	$id[1];

  $itemurl	=	sprintf($url, $id);
  $itemdesc	=	preg_replace('/[^A-Za-z0-9\s\.]+/', '', $desc[1][$i]);

  $filename	=	"$itemdesc.flv";
  if(file_exists($filename)) continue;

  echo "Fetching: " , $itemdesc, "\n";
  $youtubegrabber = new youtubegrabber($itemurl, $filename, 0);

3. modify and enjoy

Bonus: Add this to the options in the get_curl_binary method to get download progress info.

        curl_setopt($ch, CURLOPT_NOPROGRESS, FALSE);