Pitchfork 'Best New Albums' Torrent Search

Pitchfork_Best_new_Music_BTJunkie_Search

Ok so this might be slightly illegal, but I am really just generating some links.

I wrote some code that will take the RSS feed from this page: http://pitchfork.com/reviews/best/albums/ and searches BTJunkie for torrents.

Here it is in action:
http://danfolkes.com/pitchfork_torrent_albums_best/

Here is the source: (also here)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
  echo "<table border=1>";
  $doc = new DOMDocument();
  $doc->load('http://feeds2.feedburner.com/PitchforkBestNewAlbums');
 
  foreach ($doc->getElementsByTagName('item') as $node) {
	echo "<tr><th colspan='2'>";
	$title = $node->getElementsByTagName('title')->item(0)->nodeValue;
	echo $title;
    $doc2 = new DOMDocument();
 	$doc2->load("http://btjunkie.org/rss.xml?query=".urlencode($title));
	echo "</th></tr>";
	foreach ($doc2->getElementsByTagName('item') as $node2) {
		echo "<tr><td></td><td>";
		$link = "<a href='".$node2->getElementsByTagName('link')->item(0)->nodeValue."' target='_blank'>";
		$link.= $node2->getElementsByTagName('title')->item(0)->nodeValue."</a>";
		echo $link;
		echo "</td></tr>";
	}
 
  }
  //print_r($arrFeeds);
  echo "</table>";
 
?>

PHP Base64_Encode – Intentionally screwing up pictures

A screwed up base64 image.  Replaced all of the 'da' with 'ha'
A screwed up base64 image. Replaced all of the 'da' with 'ha'

So, I was a little bored so I made some PHP code.

This is what it does:

  • Takes query string values
  • Pulls an image from the web
  • base64_encodes it.
  • Distorts the image.
  • Replaces some of the base64 string data with other string data.
  • Outputs the image in an img tag.

Hope this helps someone, let me know if it does IN THE COMMENTS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
	if ((isset($_GET['i']))&&(isset($_GET['f']))&&(isset($_GET['r'])))
	{
		$find = $_GET['f'];
		$replace = $_GET['r'];
		$type = "gif";
		print_r($_GET);
 
		if (isset($_GET['t']))
		{
			$type = $_GET['t'];
		}
		$imgfile = $_GET['i'];
		$contents = implode (file($imgfile));
		$start = base64_encode($contents);
 
 
		$start = str_ireplace($find, $replace, $start);
 
	echo '<img src="data:image/'.$type.';base64,' . $start . '" />';
	}
	else
	{
	?>
		Try: <a href='base64.php?i=http://ec.europa.eu/culture/media/programme/images/logos/02/02.gif17.gif&f=lo&r=ha&t=gif'>http://ec.europa.eu/culture/media/programme/images/logos/02/02.gif17.gif&f=lo&re=ha&t=gif</a>
	<?php
	}
 
?>

PHP Gmail Imap Connection with Database Insert

gmail php mysql imap
Using PHP, We will connect to a Gmail mailbox and pull down the last message headers and to and from email addresses.
With this data, we will insert it into a MySQL Database and then delete the message from the IMAP Server.

LET ME KNOW IF THIS HELPED YOU IN THE COMMENTS! Enjoy!

Here is the code:
Continue reading “PHP Gmail Imap Connection with Database Insert”

TikiWiki – Tracker Email Subject Improvement-Modification

tikiwiki

The template for the Tracker email is here:
\tikiwiki\templates\mail\tracker_changed_notification_subject.tpl

I changed it to this so that it would improve the way it looks in emails:

{$mail_trackerName}{tr} - #{/tr}{$mail_itemId}{tr} modified.{/tr}

IP Locator Webservice – PHP – Ipmap – Command Line

This is similar to my Python script here:
http://danfolkes.com/index.php/2009/04/29/ipmapcom-python/

It uses this sites service to pull the location of each user:
http://www.ipmap.com/

It outputs in XML, Plain Text, and HTML.
Fields:

  • ip
  • hostname
  • ipreverse
  • country
  • region
  • city
  • blacklist
  • gmaps

HERE IS THE LINK TO THE WEB SERVICE SITE:
http://www.danfolkes.com/ipmaps/

CWS – Chord Web Service

cwd-chord-web-service

I am creating a web service for musicians that will allow them to reference an abundance of musical references on the fly using AJAX.

Firstly, it will deliver chords and fingerings of chords for guitars to the users websites (think Google Maps).

My goal is to enhance the web.

Here is the site: http://cws.danfolkes.com

It’s still in development, but it’s getting close to launch.

Let me know what you think (only if it’s nice) 😀