Update to MySpace Profile Tracker Pepper

by Terri Ann on December 1, 2007

I love mint and all the pepper for it but I was having trouble with the Myspace Profile Tracker by John Baker mainly just that it wasn’t tracking anything.

So I began to investigate.

I went to directly load the image and found it was prompting me to download the png. Meaning the .htaccess file wasn’t working (I assumed) so I made some modifications.

Instead of having the .htaccess file treat the PNG file as PHP I renamed the PHP file to ‘register.png.php’ and replaced my .htaccess file with this:

Options +FollowSymLinks
RewriteEngine On
RewriteBase    /mint/pepper/johnbarker/myspace/
RewriteRule ^register.png$          register.png.php  [QSA]

I uploaded the file logo.png into that Myspace directory so I could have an image display and also double as a link to my blog.

Then I added this to the bottom of my newly renamed register.png.php file

$image =  imagecreatefrompng('logo.png');
header('Content-type: image/png') ;
ImagePNG($image) ;
ImageDestroy($image) ;
exit ;

This way loading the image register.png would redirect (via the Rewrite rules in the .htacces file) to register.png.php which would save all the information to mint, then load the logo.png file and output it. Pretty cool.

And it still uses the same image tag as the original readme.

<img src="http://www.ninedays.org/mint/pepper/johnbarker/myspace/register.png" alt="" />

Now it works and tracks visitors so well! There may have been an easier modification but this one works and that’s all that matters for me.

{ 2 comments… read them below or add one }

1 John Barker March 2, 2008 at 1:39 am

I like what you’ve done here. I may implement this method into the next release as it seems it may be more of a universal “work.”

Thanks!

2 hausmitteilungen April 3, 2008 at 4:34 pm

Great – I’m using this for my last.fm-profile which works also!

Would be neat to have the pepper to recognize the ignore-cookie, but I think I’ll post this over at havemint.com as well, this pepper could be used in several more places than MySpace…

Leave a Comment

Previous post: 301 Redirects from your Wordpress 404 Error Page

Next post: Feed Image Wordpress Plugin