<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DUAMQXg7fip7ImA9WhVREEk.&quot;"><id>tag:blogger.com,1999:blog-4721982885013708497</id><updated>2012-03-18T05:16:20.606Z</updated><category term="Gadgets" /><category term="Twitter" /><category term="TCE Website" /><category term="Perl" /><category term="Project HTTPortscan" /><category term="OAuth" /><category term="Honeybot" /><category term="Echobot" /><category term="Linux" /><category term="Uncatergorised" /><title>James Januszka</title><subtitle type="html">All things geek</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://jims-tech.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://jims-tech.blogspot.com/" /><author><name>Jims</name><uri>http://www.blogger.com/profile/11132506777555384693</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp0.blogger.com/__wNYCvyCDR0/SAZ1imxSxTI/AAAAAAAAAB4/qHmHZot4RCY/S220/n680692270_9067.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/JamesJanuszka" /><feedburner:info uri="jamesjanuszka" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;CEAHRXs_cCp7ImA9Wx9aFEg.&quot;"><id>tag:blogger.com,1999:blog-4721982885013708497.post-5350194100407264199</id><published>2011-03-06T23:05:00.000Z</published><updated>2011-03-06T23:05:34.548Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-06T23:05:34.548Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="OAuth" /><category scheme="http://www.blogger.com/atom/ns#" term="Perl" /><category scheme="http://www.blogger.com/atom/ns#" term="Twitter" /><title>Twitter OAuth Perl Module</title><content type="html">Since Twitter changed their authentication method for using their API to OpenAuth, sending an automated tweet has become a whole lot more difficult.&lt;br /&gt;
In response to this I decided to code my own PERL module for OAuth.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;Limitations of the module&lt;/h4&gt;&lt;br /&gt;
Just before I post the code below I will mention that all this module currently does is allow you to post tweets, it does not handle retrieving access tokens or any other OAuth jazz. This module is really for single user twitter apps, like RSS feeds and twitter bots, or other situations where you already have all the required access tokens. If you register an app on twitter as a single access app, twitter will give you all the OAuth tokens you need. Point your browser at&amp;nbsp;&lt;a href="http://twitter.com/apps/new"&gt;http://twitter.com/apps/new&lt;/a&gt; and sign in as your twitter bot or RSS feed posting account.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;The Code&lt;/h4&gt;&lt;br /&gt;
&lt;pre&gt;package Jimtweet;
#####JimTweet 0.1 By James Januszka 2010
#####Email:jimjanuszka@gmail.com
#####Twitter:@jamesjanuszka
use strict;
use warnings;
use LWP;
use HTTP::Headers;
use URI::Encode qw(uri_encode);
use URI::Escape qw(uri_escape);
use Digest::HMAC_SHA1;

####Constructor####
sub new {
 my $self={};
 $self-&amp;gt;{OAUTH_VERSION}=uri_escape("1.0");
 $self-&amp;gt;{OAUTH_SIGNATURE_METHOD}=uri_escape("HMAC-SHA1");
 $self-&amp;gt;{OAUTH_TIMESTAMP}=undef;
 $self-&amp;gt;{OAUTH_NONCE}=undef;
 $self-&amp;gt;{AGENT}="jimtweet/0.1";
 $self-&amp;gt;{URL}="http://api.twitter.com/1/statuses/update.xml";
 $self-&amp;gt;{BROWSER}=LWP::UserAgent-&amp;gt;new(agent =&amp;gt;$self-&amp;gt;{AGENT});
 $self-&amp;gt;{CONSUMER_KEY}=undef;
 $self-&amp;gt;{CONSUMER_SECRET}=undef;
 $self-&amp;gt;{OAUTH_TOKEN}=undef;
 $self-&amp;gt;{OAUTH_TOKEN_SECRET}=undef;
 $self-&amp;gt;{STATUS}=undef;
 bless($self);
 return $self;
} 

sub consumer_key{
 my $self=shift;
        if (@_) { $self-&amp;gt;{CONSUMER_KEY}=uri_escape(shift) }
        return $self-&amp;gt;{CONSUMER_KEY};
}
sub consumer_secret{
 my $self = shift;
        if (@_) { $self-&amp;gt;{CONSUMER_SECRET}=uri_escape(shift) }
        return $self-&amp;gt;{CONSUMER_SECRET};
}
sub oauth_token{
 my $self = shift;
        if (@_) { $self-&amp;gt;{OAUTH_TOKEN}=uri_escape(shift) }
        return $self-&amp;gt;{OAUTH_TOKEN};
}
sub oauth_token_secret{
 my $self = shift;
        if (@_) { $self-&amp;gt;{OAUTH_TOKEN_SECRET}=uri_escape(shift) }
        return $self-&amp;gt;{OAUTH_TOKEN_SECRET};
}

sub update_status(@){
 sleep(2);
 my $self = shift;
        if (@_) { $self-&amp;gt;{STATUS}=uri_escape(shift) }
        my $seconds = time(); 
        $self-&amp;gt;{OAUTH_TIMESTAMP}=uri_escape($seconds);
        $self-&amp;gt;{OAUTH_NONCE}=$self-&amp;gt;{OAUTH_TIMESTAMP};
       
       my $query=qq(oauth_consumer_key=$self-&amp;gt;{CONSUMER_KEY}&amp;amp;oauth_nonce=$self-&amp;gt;{OAUTH_NONCE}&amp;amp;oauth_signature_method=$self-&amp;gt;{OAUTH_SIGNATURE_METHOD}&amp;amp;oauth_timestamp=$self-&amp;gt;{OAUTH_TIMESTAMP}&amp;amp;oauth_token=$self-&amp;gt;{OAUTH_TOKEN}&amp;amp;oauth_version=$self-&amp;gt;{OAUTH_VERSION}&amp;amp;status=$self-&amp;gt;{STATUS});
       
       my $sig="POST&amp;amp;";
$sig .=uri_encode($self-&amp;gt;{URL},1);
$sig .="&amp;amp;";
$sig .=uri_encode($query,1);


my $sig_key=$self-&amp;gt;{CONSUMER_SECRET};
$sig_key .="&amp;amp;";
$sig_key .=$self-&amp;gt;{OAUTH_TOKEN_SECRET};

my $hmac = Digest::HMAC_SHA1-&amp;gt;new($sig_key);
$hmac-&amp;gt;add($sig);
my $oauth_signature_base64=$hmac-&amp;gt;b64digest;
$oauth_signature_base64 .="=";
my $utf8_oauth_signature_base64=uri_escape($oauth_signature_base64);

my $debug="-v";
my $curlpost=qq(status=$self-&amp;gt;{STATUS});

my $header=qq(OAuth oauth_nonce="$self-&amp;gt;{OAUTH_NONCE}", oauth_signature_method="$self-&amp;gt;{OAUTH_SIGNATURE_METHOD}", oauth_timestamp="$self-&amp;gt;{OAUTH_TIMESTAMP}", oauth_consumer_key="$self-&amp;gt;{CONSUMER_KEY}", oauth_token="$self-&amp;gt;{OAUTH_TOKEN}", oauth_signature="$utf8_oauth_signature_base64", oauth_version="$self-&amp;gt;{OAUTH_VERSION}");
my $req=HTTP::Request-&amp;gt;new(POST =&amp;gt; $self-&amp;gt;{URL});
$req-&amp;gt;content_type('application/x-www-form-urlencoded');
$req-&amp;gt;content($curlpost);

$req-&amp;gt;header('Authorization' =&amp;gt; $header);  # set

my $res = $self-&amp;gt;{BROWSER}-&amp;gt;request($req);
return 1
}

####Footer####
1;  #so the require or use succeeds 

&lt;/pre&gt;&lt;br /&gt;
&lt;h4&gt;Usage&lt;/h4&gt;&lt;br /&gt;
The first thing you need to do is include the module in your perl script, then you have to set up a new tweet object.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;my $tweet=Jimtweet-&amp;gt;new();&lt;/pre&gt;&lt;br /&gt;
Next you have to specify your OAuth tokens&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;$tweet-&amp;gt;consumer_key($consumer_key);
$tweet-&amp;gt;consumer_secret($consumer_secret);&amp;nbsp;
$tweet-&amp;gt;oauth_token($oauth_token);
$tweet-&amp;gt;oauth_token_secret($oauth_token_secret);&lt;/pre&gt;&lt;br /&gt;
Finally to send a tweet&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;$tweet-&amp;gt;update_status($status);&lt;/pre&gt;&lt;br /&gt;
The module sets up the nonce and timestamp for you as well as setting up the OAuth signature that many people have trouble with.&lt;br /&gt;
&lt;br /&gt;
Well thats it I hope you all like it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4721982885013708497-5350194100407264199?l=jims-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/TOkEBNAt1T52IZltjP28-sgPxM4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/TOkEBNAt1T52IZltjP28-sgPxM4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/TOkEBNAt1T52IZltjP28-sgPxM4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/TOkEBNAt1T52IZltjP28-sgPxM4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/JamesJanuszka/~4/9tyRoiQjxxM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jims-tech.blogspot.com/feeds/5350194100407264199/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://jims-tech.blogspot.com/2011/03/twitter-oauth-perl-module.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/5350194100407264199?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/5350194100407264199?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JamesJanuszka/~3/9tyRoiQjxxM/twitter-oauth-perl-module.html" title="Twitter OAuth Perl Module" /><author><name>Jims</name><uri>http://www.blogger.com/profile/11132506777555384693</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp0.blogger.com/__wNYCvyCDR0/SAZ1imxSxTI/AAAAAAAAAB4/qHmHZot4RCY/S220/n680692270_9067.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://jims-tech.blogspot.com/2011/03/twitter-oauth-perl-module.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A04ARn49cCp7ImA9WxVbEUs.&quot;"><id>tag:blogger.com,1999:blog-4721982885013708497.post-3293987391429563249</id><published>2009-03-27T16:03:00.002Z</published><updated>2009-03-27T16:05:47.068Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-27T16:05:47.068Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Linux" /><category scheme="http://www.blogger.com/atom/ns#" term="Uncatergorised" /><title>Tutorial on Converting and Burning an AVI File onto DVD</title><content type="html">&lt;img align="left" height="180" src="http://farm1.static.flickr.com/103/313252221_cf49d277a3_m.jpg" style="margin-right: 5px;" width="240" /&gt;&lt;br /&gt;
This is going to be a quick tutorial on how to convert an avi movie so that it can be burned onto a DVD, all done via the terminal in Linux. For Extra credit I will also show you how you can to this on a remote computer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For this you will need the following tools:&lt;br /&gt;
&lt;br /&gt;
&lt;ul style="list-style-type: none;"&gt;&lt;li&gt;&lt;a href="http://dvdauthor.sourceforge.net/"&gt;DVDAuthor&lt;/a&gt;&lt;/li&gt;
&lt;li&gt; &lt;a href="http://tovid.wikia.com/wiki/Installing_tovid"&gt;Tovid&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;Optional: Setting up a remote connection&lt;/h4&gt;On my setup at home my Desktop PC has the tools and the avi on them, but my laptop is over by the comfy sofa. So what I do is ssh in to my PC from my laptop on the sofa. I also use a program called &lt;a href="http://www.gnu.org/software/screen/"&gt;Screen.&lt;/a&gt;&lt;br /&gt;
This is an example of what I do.&lt;br /&gt;
&lt;pre&gt;screen ssh &amp;lt;ip of desktop of pc&amp;gt;&lt;/pre&gt;&lt;br /&gt;
&lt;h4&gt;Convert the AVI into MPEG&lt;/h4&gt;As DVD films are more or less in the mpeg format and the film we want to burn is an avi. We need to convert it into a mpeg.&lt;br /&gt;
First we use the screen program this allows us to set a program running and then close the terminal window and the program continues to run.&lt;br /&gt;
&lt;pre&gt;screen&lt;/pre&gt;&lt;br /&gt;
Now we need to use Tovid. This will convert the avi into the desired mpeg format. On my system a two hour film takes just over two hours to convert.&lt;br /&gt;
&lt;pre&gt;tovid -dvd -pal -in movie.avi -out movie&lt;/pre&gt;&lt;b&gt;Don't forget this is going to take a long time.&amp;nbsp; &lt;/b&gt;I shall now explain the switches used.&lt;br /&gt;
&lt;br /&gt;
The &lt;b&gt;dvd&lt;/b&gt; switch basicly converts the avi into dvd screen resolution. The &lt;b&gt;pal&lt;/b&gt; switch converts the avi in to the PAL format. Tovid defaults to NTSC. The &lt;b&gt;in&lt;/b&gt; switch is the path to the avi, and the &lt;b&gt;out&lt;/b&gt;  switch is the prefix of the mpeg file we wish to create.&lt;br /&gt;
&lt;br /&gt;
When this is done we will have a shiney new file called movie.mpg which we can convert into the DVD format.&lt;br /&gt;
&lt;h4&gt;Convert the mpeg into DVD file format&lt;/h4&gt;OK the last step took about two hours, but don't worry the next couple of steps are going to take 10 minutes tops.&lt;br /&gt;
&lt;br /&gt;
Before we burn the mpeg file on to the DVD we need to create a DVD filesystem. We do this;&lt;br /&gt;
&lt;pre&gt;dvdauthor -t -v pal movie.mpg  -o movie/&lt;/pre&gt;&lt;br /&gt;
The &lt;b&gt;t&lt;/b&gt; switch gives the DVD a title. All DVD files need a tile so we give it a blank one. The &lt;b&gt;v pal&lt;/b&gt; switch is just to make sure it remains in the PAL format. Then we have the name of the mpg file, finally the &lt;b&gt;o&lt;/b&gt; switch is the path to the DVD filesytem.&lt;br /&gt;
&lt;br /&gt;
Once we have done this we just run;&lt;br /&gt;
&lt;pre&gt;dvdauthor -T -o movie/&lt;/pre&gt;&lt;br /&gt;
This just gives the the DVD a table of contents, which as far as I'm aware is just needed so we can burn the DVD.&lt;br /&gt;
&lt;h4&gt;Lets burn this baby to disc&lt;/h4&gt;Now we have the DVD filesytem on our PC we need to get it on to a coaster.&lt;br /&gt;
&lt;pre&gt;growisofs -dvd-video -Z /dev/dvd movie/&lt;/pre&gt;&lt;b&gt;/dev/dvd&lt;/b&gt; is the path to your DVD writer and &lt;b&gt;movie/&lt;/b&gt; is the path to your movie DVD filesytem we created in the previous step.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;In Summary&lt;/h4&gt;Well thats it we managed to burn an avi file onto a dvd just using the terminal, and we didn't even need to use a GUI. This process usually takes about 2.5 hours, so using screen comes in handy as we can just let it run in the background.&lt;br /&gt;
&lt;br /&gt;
Now lets have all the commands we used in one place.&lt;br /&gt;
&lt;pre&gt;screen
tovid -dvd -pal -in movie.avi -out movie
dvdauthor -t -v pal movie.mpg  -o movie/
dvdauthor -T -o movie/
growisofs -dvd-video -Z /dev/dvd movie/
&lt;/pre&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&lt;i&gt;picture credit &lt;a href="http://www.flickr.com/photos/spadgy/313252221/sizes/s/"&gt;john_a_ward&lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4721982885013708497-3293987391429563249?l=jims-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/g4rSDCuCFLa3dycBA4u-gTJbxPk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/g4rSDCuCFLa3dycBA4u-gTJbxPk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/g4rSDCuCFLa3dycBA4u-gTJbxPk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/g4rSDCuCFLa3dycBA4u-gTJbxPk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/JamesJanuszka/~4/tzvS0l9-8jg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jims-tech.blogspot.com/feeds/3293987391429563249/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://jims-tech.blogspot.com/2009/03/tutorial-on-converting-and-burning-avi.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/3293987391429563249?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/3293987391429563249?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JamesJanuszka/~3/tzvS0l9-8jg/tutorial-on-converting-and-burning-avi.html" title="Tutorial on Converting and Burning an AVI File onto DVD" /><author><name>Jims</name><uri>http://www.blogger.com/profile/11132506777555384693</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp0.blogger.com/__wNYCvyCDR0/SAZ1imxSxTI/AAAAAAAAAB4/qHmHZot4RCY/S220/n680692270_9067.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://farm1.static.flickr.com/103/313252221_cf49d277a3_t.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://jims-tech.blogspot.com/2009/03/tutorial-on-converting-and-burning-avi.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0UMQHgycCp7ImA9WxRTF08.&quot;"><id>tag:blogger.com,1999:blog-4721982885013708497.post-285744868181891678</id><published>2008-09-06T18:15:00.001+01:00</published><updated>2008-09-06T19:21:21.698+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-06T19:21:21.698+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Perl" /><category scheme="http://www.blogger.com/atom/ns#" term="Twitter" /><title>Getmail for twitter</title><content type="html">&lt;img align="left" height="180" src="http://farm1.static.flickr.com/150/357278024_631c4f0655.jpg" style="margin-right: 5px;" width="240" /&gt;Getmail a nice little Perl script that when setup with a cron job automatically scans your inbox on behalf of you or one of your twitter apps for emails from twitter and responds accordingly.&lt;br /&gt;
&lt;br /&gt;
There are two types of email messages it responds to the first, is the email you get from twitter when someone sends you a direct message, the second is the one that twitter sends you when someone follows you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;How it works &lt;/h4&gt;The Getmail script works as an &lt;a href="http://www.imap.org/"&gt;imap&lt;/a&gt; client and accesses the inbox of whichever twitter bot it is monitoring. It uses the &lt;a href="http://search.cpan.org/dist/Mail-IMAPClient/lib/Mail/IMAPClient.pod"&gt;Mail::IMAPClient&lt;/a&gt; perl module. Once it has successfully connected to the mail sever it selects a mail box, ie your inbox, or a specific mailbox of your choosing.&lt;br /&gt;
&lt;br /&gt;
Once inside it looks for any recent mail. To put it another way it checks for any mail that has the imap RECENT flag attached to it. There is a slight problem with this method in that a message is only flagged as RECENT if no other imap clients have seen it, bare that in mind if you want to use this on your personal mail box, it will stop the script from seeing any mail.&lt;br /&gt;
&lt;br /&gt;
When the script finds a message that is RECENT it checks the headers for the twitter custom headers (for example "X-Twitteremailtype"), and checks their value.&lt;br /&gt;
&lt;br /&gt;
If the X-Twitteremailtype value is "is_following" then it calls a subroutine called follow. This subroutine doesn't do anything yet, it's up to you to fill it with commands. The most obvious would be to auto-follow.&lt;br /&gt;
&lt;br /&gt;
If the&amp;nbsp; X-Twitteremailtype is "direct_message" then it calls an empty subroutine called directMsg, once again it's up to you the user of the script to define what that subroutine does.&lt;br /&gt;
&lt;br /&gt;
Any other emails it finds in the inbox it just ignores, which is probably a good thing ;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;Possible Applications of this groovy script &lt;/h4&gt;&lt;br /&gt;
You are free to do with this script what ever you wish, of course. This script will obviously be useful if you want to auto-follow people who follow you, or your twitter app. Some people may find use for the directMsg subroutine.&lt;br /&gt;
&lt;br /&gt;
My reason for writting this script was so I co redesign &lt;a href="http://www.twitter.com/echobot"&gt;echobot&lt;/a&gt; to auto-follow new users and to check direct messages without having to query twitter.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;The Source Code&lt;/h4&gt;&lt;pre&gt;#!/usr/bin/perl

# Getmail.pl (For Twitter)
# By James Januszka, @jamesjanuszka, http://blog.jamesjanuszka.com
# Do as you will with this script but don't blame me if it f**k's up

use strict; # Spank me!
use warnings; # Stop or I'll shoot!
use Mail::IMAPClient;
my $host = "imap.smurfmail.net"; # Contact your email admin for this address
my $username = "pappa\@smurf.com"; # Don't forget to escape characters. Example \@
my $pass = "I &amp;lt;3 Smurfette"; # If you don't know this then, er ... Good Luck!
my $folder ="INBOX";# Which folder you want to look in. Example INBOX 
my $imap;

sub login{
 # login
  $imap = Mail::IMAPClient-&amp;gt;new(
            Server =&amp;gt; $host,
            User    =&amp;gt; $username,
            Password=&amp;gt; $pass,
            )or die "Cannot connect to $host as $username: $@";
}

sub checkMail{
 # Check your mail
 $imap-&amp;gt;select($folder) or die "Could not select: $@\n";
 my @recent = $imap-&amp;gt;recent;# This checks for recent mail, if you check this mailbox with another client then run this script, it won't have any recent mail. Sorry thats the IMAP specification for you.
 foreach (@recent){
  my $messageType = $imap-&amp;gt;get_header($_, "X-Twitteremailtype");
  my $messageFrom = $imap-&amp;gt;get_header($_, "X-Twittersenderscreenname");
  my $messageString = $imap-&amp;gt;body_string($_);
  if ($messageType eq "direct_message"){
   directMsg("$messageString");
  }
  if ($messageType eq "is_following"){
   follow($messageFrom);
  } 
 }
 
}

sub directMsg{
 # Do what you do with your direct messages here. 
 my @string = split(/\r/, "@_");# Split message email by returns, I used /r because /n was giving me problems
 print "$string[0] \n";
}

sub follow{
 # Do what you do when someone follows you. Ooh could this be a way of Auto-following someone ? ;)
 print "##########################FOLLOW @_#########################\n";
}


sub logout {
 #logout
 $imap-&amp;gt;logout or die "Could not logout: $@\n";
}

# It's all very well writing pretty subroutines, but you need to remember to call them 
login;
checkMail;
logout;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&lt;i&gt;picture credit &lt;a href="http://www.flickr.com/photos/gaetanlee/357278024/"&gt;gaetanlee&lt;/a&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;i&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp;&lt;/span&gt; &lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4721982885013708497-285744868181891678?l=jims-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8wxCmg585KPzYdxWwMgbDjeRM-Y/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8wxCmg585KPzYdxWwMgbDjeRM-Y/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8wxCmg585KPzYdxWwMgbDjeRM-Y/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8wxCmg585KPzYdxWwMgbDjeRM-Y/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/JamesJanuszka/~4/nyJOeUCFMZk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jims-tech.blogspot.com/feeds/285744868181891678/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://jims-tech.blogspot.com/2008/09/getmail-for-twitter.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/285744868181891678?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/285744868181891678?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JamesJanuszka/~3/nyJOeUCFMZk/getmail-for-twitter.html" title="Getmail for twitter" /><author><name>Jims</name><uri>http://www.blogger.com/profile/11132506777555384693</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp0.blogger.com/__wNYCvyCDR0/SAZ1imxSxTI/AAAAAAAAAB4/qHmHZot4RCY/S220/n680692270_9067.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://farm1.static.flickr.com/150/357278024_631c4f0655_t.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://jims-tech.blogspot.com/2008/09/getmail-for-twitter.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEUAQXo5fyp7ImA9WxdVE0U.&quot;"><id>tag:blogger.com,1999:blog-4721982885013708497.post-1613621569758401706</id><published>2008-07-18T12:47:00.005+01:00</published><updated>2008-07-18T14:04:00.427+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-18T14:04:00.427+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Honeybot" /><category scheme="http://www.blogger.com/atom/ns#" term="Twitter" /><title>Project Honeybot</title><content type="html">Twitter is a great platform for expressing ideas and keeping up with what is going on in the world, but there is also a downside and thats spam. There seems to be alot of twitter users which are just spam bots they just keep following people hopeing to sell you viagra. I think I have found away to name and shame them.&lt;br /&gt;&lt;h4&gt;Enter Honeybot&lt;/h4&gt;Honeybot is my counter defense to this, what it does is constantly posts to the public time line a warning not to follow it. Now I believe that spambots constantly scrape the public timeline and follow whoevers on there. So they should in theory follow Honeybot automaticly.&lt;br /&gt;&lt;br /&gt;The second thing it does is keeps a record of its followers, allowing me to create a public blacklist of it's followers.&lt;br /&gt;&lt;h4&gt;Creating a Blacklist of Spambots&lt;/h4&gt;What I intend to do is post the list of followers on my website where people can see if they are being followed by spammers. It's basicly a copy of the xml file of followers you can obtain from the twitter API, but I am going to parse it into a more readable format.&lt;br /&gt;&lt;h4&gt;Source Code&lt;/h4&gt;below is a copy of the source code so you can see how it works:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;#!/usr/bin/perl -w&lt;br /&gt;## Honeybot - This bot attempts to attract spam bots and creates a spambot blacklist&lt;br /&gt;## James Januszka, 2008, http://blog.jamesjanuszka.com&lt;br /&gt;##&lt;br /&gt;use strict;&lt;br /&gt;use LWP;&lt;br /&gt;use LWP::Simple;&lt;br /&gt;use URI;&lt;br /&gt;my $agent ='Honeybot/0.1';my $statusurl = 'http://twitter.com/statuses/update.xml';&lt;br /&gt;my $followerurl = 'http://twitter.com/statuses/followers.xml?lite=true';&lt;br /&gt;my $server ='twitter.com:80';&lt;br /&gt;my $realm ="Twitter API";&lt;br /&gt;my $username = "enteryourusername";&lt;br /&gt;my $password ="enteryourpassword";&lt;br /&gt;my $file="followers.xml";&lt;br /&gt;my $string ="Please do not follow this bot as any followers will be added to the blacklist. See http://tinyurl.com/5bomg4 for more details.".int(rand(100000));&lt;br /&gt;my $browser = LWP::UserAgent-&amp;gt;new(agent =&amp;gt;$agent);&lt;br /&gt;$browser-&amp;gt;credentials($server,$realm,$username=&amp;gt;$password);&lt;br /&gt;print "Content-type: text/html\n\n";&lt;br /&gt;&lt;br /&gt;&amp;amp;updatestatus();&lt;br /&gt;&amp;amp;getfollowers();&lt;br /&gt;&lt;br /&gt;sub updatestatus {&lt;br /&gt; my $response =$browser-&amp;gt;post($statusurl,['status'=&amp;gt;$string]);&lt;br /&gt; die "OMG, WTF: ",$response-&amp;gt;header('WWW-Authenticate'), $response-&amp;gt;status_line unless $response-&amp;gt;is_success;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;sub getfollowers {&lt;br /&gt; system("wget  --http-user=$username --http-passwd=$password -O $file  -U $agent $followerurl");&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I hope that this will be a useful service for twitter users, if you have any comments about how I can improve Honeybot let me know.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4721982885013708497-1613621569758401706?l=jims-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/tkS5M8UUEIn895yQVpFrjfU3R9U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tkS5M8UUEIn895yQVpFrjfU3R9U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/tkS5M8UUEIn895yQVpFrjfU3R9U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tkS5M8UUEIn895yQVpFrjfU3R9U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/JamesJanuszka/~4/p2SFC0VENns" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jims-tech.blogspot.com/feeds/1613621569758401706/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://jims-tech.blogspot.com/2008/07/project-honeybot.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/1613621569758401706?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/1613621569758401706?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JamesJanuszka/~3/p2SFC0VENns/project-honeybot.html" title="Project Honeybot" /><author><name>Jims</name><uri>http://www.blogger.com/profile/11132506777555384693</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp0.blogger.com/__wNYCvyCDR0/SAZ1imxSxTI/AAAAAAAAAB4/qHmHZot4RCY/S220/n680692270_9067.jpg" /></author><thr:total>3</thr:total><feedburner:origLink>http://jims-tech.blogspot.com/2008/07/project-honeybot.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0YER3g9cCp7ImA9WxdVEUk.&quot;"><id>tag:blogger.com,1999:blog-4721982885013708497.post-4822724248624473547</id><published>2008-07-11T14:52:00.008+01:00</published><updated>2008-07-15T20:11:46.668+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-15T20:11:46.668+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Uncatergorised" /><title>Creative Commons and Flickr</title><content type="html">&lt;a id="v6sj" href="http://www.flickr.com/photos/jimjanuszka/2657309488/" title="Owl at Southend Airshow 2008 by jimjanuszka, on Flickr"&gt;&lt;img id="v6sj0" src="http://farm4.static.flickr.com/3081/2657309488_db97d91763_m.jpg" alt="Owl at Southend Airshow 2008" align="left" height="180" width="240" style="margin-right:5px" /&gt;&lt;/a&gt; I have just opened an account at &lt;a id="wxum" href="http://www.flickr.com/"&gt;Flickr&lt;/a&gt; so I can upload some photos to it. One of the reasons I choose Flickr, is that you have the option of registering your images photos under a &lt;a title="Creative Commons" href="http://creativecommons.org/" id="aqhq"&gt;Creative Commons&lt;/a&gt; License(&lt;b id="bdl2" title="Creative Commons"&gt;CC&lt;/b&gt;), instead of them being copyrighted by default. &lt;h4 id="tt86"&gt;Copyright v Creative Commons&lt;/h4&gt; Traditionally people have wanted to protect their ideas and artworks, this enables them to retain control of who does what with their property. Copyright works in this area, and is the norm in commercial circles.    Nowadays people are writing blogs and uploading their photos to various social media websites. &lt;b id="bdl20" title="Creative Commons"&gt;CC&lt;/b&gt; allows people to use other peoples media on their blogs, whilst still giving the owner of the media some rights on how their media is used.  &lt;h4 id="e_k-"&gt;Creative Commons Licenses&lt;/h4&gt; The thing with &lt;b id="bdl21" title="Creative Commons"&gt;CC&lt;/b&gt; is it allows you to set various levels of restrictions on your work. Below is a brief summary of each license copy &amp;amp; pasted from &lt;a title="http://creativecommons.org/about/license/" href="http://creativecommons.org/about/license/" id="k6xi"&gt;http://creativecommons.org/about/license/&lt;/a&gt;.    &lt;b id="fopq"&gt;&lt;br /&gt;&lt;br /&gt;Attribution (by)&lt;/b&gt;&lt;br /&gt;This license lets others distribute, remix, tweak, and build upon your work, even commercially, as long as they credit you for the original creation. This is the most accommodating of licenses offered, in terms of what others can do with your works licensed under Attribution.&lt;br /&gt;&lt;br /&gt;&lt;b id="fopq2"&gt;Attribution Share Alike (by-sa)&lt;/b&gt;&lt;br /&gt;This license lets others remix, tweak, and build upon your work even for commercial reasons, as long as they credit you and license their new creations under the identical terms. This license is often compared to open source software licenses. All new works based on yours will carry the same license, so any derivatives will also allow commercial use.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;b id="fopq6"&gt;Attribution No Derivatives (by-nd)&lt;/b&gt;&lt;br /&gt;This license allows for redistribution, commercial and non-commercial, as long as it is passed along unchanged and in whole, with credit to you.&lt;br /&gt;&lt;br /&gt;&lt;b id="fopq10"&gt;Attribution Non-commercial (by-nc)&lt;/b&gt;&lt;br /&gt;This license lets others remix, tweak, and build upon your work non-commercially, and although their new works must also acknowledge you and be non-commercial, they don’t have to license their derivative works on the same terms.&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;b id="fopq14"&gt;Attribution Non-commercial Share Alike (by-nc-sa)&lt;/b&gt;&lt;br /&gt;This license lets others remix, tweak, and build upon your work non-commercially, as long as they credit you and license their new creations under the identical terms. Others can download and redistribute your work just like the by-nc-nd license, but they can also translate, make remixes, and produce new stories based on your work. All new work based on yours will carry the same license, so any derivatives will also be non-commercial in nature.&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;b id="fopq17"&gt;Attribution Non-commercial No Derivatives (by-nc-nd)&lt;/b&gt;&lt;br /&gt;This license is the most restrictive of our six main licenses, allowing redistribution. This license is often called the “free advertising” license because it allows others to download your works and share them with others as long as they mention you and link back to you, but they can’t change them in any way or use them commercially.&lt;br /&gt;&lt;br /&gt;In summary I believe that if more people are aware of &lt;b id="dxnh" title="Creative Commons"&gt;CC&lt;/b&gt; both media owners and media users, then this will have a positive effect as blog writers will use more good quality media in their blogs.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4721982885013708497-4822724248624473547?l=jims-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/6RD1DcYZnBai4s-AA55iLcJXHEg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6RD1DcYZnBai4s-AA55iLcJXHEg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/6RD1DcYZnBai4s-AA55iLcJXHEg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6RD1DcYZnBai4s-AA55iLcJXHEg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/JamesJanuszka/~4/A3cl7fl5NeA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jims-tech.blogspot.com/feeds/4822724248624473547/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://jims-tech.blogspot.com/2008/07/i-have-just-opened-account-at-flicr-so.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/4822724248624473547?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/4822724248624473547?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JamesJanuszka/~3/A3cl7fl5NeA/i-have-just-opened-account-at-flicr-so.html" title="Creative Commons and Flickr" /><author><name>Jims</name><uri>http://www.blogger.com/profile/11132506777555384693</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp0.blogger.com/__wNYCvyCDR0/SAZ1imxSxTI/AAAAAAAAAB4/qHmHZot4RCY/S220/n680692270_9067.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://farm4.static.flickr.com/3081/2657309488_db97d91763_t.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://jims-tech.blogspot.com/2008/07/i-have-just-opened-account-at-flicr-so.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0QHRHY6cSp7ImA9WxdQE00.&quot;"><id>tag:blogger.com,1999:blog-4721982885013708497.post-6194181034172952156</id><published>2008-06-10T19:48:00.004+01:00</published><updated>2008-06-12T22:15:35.819+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-12T22:15:35.819+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Perl" /><title>TinyUrl Perl Script</title><content type="html">It's been a while since my last post so I thought I'd write up a quick post about what I did today.&lt;br /&gt;&lt;br /&gt;I've been using the &lt;a href="http://www.tinyurl.com"&gt;TinyUrl&lt;/a&gt; service for some time now and I came across their API, so I though I'd knock up a quick 'n' dirty script to make my TinyUrling easier.&lt;br /&gt;&lt;pre&gt;#!/usr/bin/perl -w&lt;br /&gt;use strict;&lt;br /&gt;use LWP;&lt;br /&gt;my $input = $ARGV[0];&lt;br /&gt;$input =~ s/^ht{2}p:\/{2}//;&lt;br /&gt;my $url = 'http://tinyurl.com/api-create.php?url=http://'.$input;&lt;br /&gt;my $browser = LWP::UserAgent-&gt;new;&lt;br /&gt;my $response = $browser-&gt;get($url);&lt;br /&gt;die "Can't get $url --", $response-&gt;status_line unless $response-&gt;is_success;&lt;br /&gt;print $response-&gt;content."\n"&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This script takes your input and prints out the TinyUrl of it, usage is as follows;&lt;br /&gt;&lt;pre&gt;$ perl -w tinyurl.pl www.google.com&lt;/pre&gt;&lt;br /&gt;which gives an output of;&lt;br /&gt;&lt;pre&gt;http://tinyurl.com/1c2&lt;/pre&gt;&lt;br /&gt;Not bad for about 5 minutes work, I hope you will agree.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4721982885013708497-6194181034172952156?l=jims-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/NIBFtLFPJX45k611efQtMxS64WI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NIBFtLFPJX45k611efQtMxS64WI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/NIBFtLFPJX45k611efQtMxS64WI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NIBFtLFPJX45k611efQtMxS64WI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/JamesJanuszka/~4/QwVhC4vysH4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jims-tech.blogspot.com/feeds/6194181034172952156/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://jims-tech.blogspot.com/2008/06/tinyurl-perl-script.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/6194181034172952156?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/6194181034172952156?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JamesJanuszka/~3/QwVhC4vysH4/tinyurl-perl-script.html" title="TinyUrl Perl Script" /><author><name>Jims</name><uri>http://www.blogger.com/profile/11132506777555384693</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp0.blogger.com/__wNYCvyCDR0/SAZ1imxSxTI/AAAAAAAAAB4/qHmHZot4RCY/S220/n680692270_9067.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://jims-tech.blogspot.com/2008/06/tinyurl-perl-script.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEYCQ3c7fCp7ImA9WxdVE0U.&quot;"><id>tag:blogger.com,1999:blog-4721982885013708497.post-800433681545654039</id><published>2008-05-07T22:49:00.003+01:00</published><updated>2008-07-18T14:02:42.904+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-18T14:02:42.904+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Echobot" /><category scheme="http://www.blogger.com/atom/ns#" term="Twitter" /><title>Echobot now living at Bobsbasement</title><content type="html">I've had a word with my friend BOfH, and he has kindly agreed to host Echobot on his server at &lt;a href="http://www.bobsbasement.co.uk/"&gt;www.bobsbasement.co.uk&lt;/a&gt;. This now means that Echobot is available 24/7 and replies to it's messages every 10 minutes.&lt;br /&gt;&lt;br /&gt;Now that Echobot has settled in, I can begin working on my other projects. Watch this space for project Tubeupdate and GMail Twitterfier.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4721982885013708497-800433681545654039?l=jims-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/dK3HlfCg8EdWSb2jimtPHmTaKt0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dK3HlfCg8EdWSb2jimtPHmTaKt0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/dK3HlfCg8EdWSb2jimtPHmTaKt0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dK3HlfCg8EdWSb2jimtPHmTaKt0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/JamesJanuszka/~4/OydbmrSKSE8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jims-tech.blogspot.com/feeds/800433681545654039/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://jims-tech.blogspot.com/2008/05/echobot-now-living-at-bobsbasement.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/800433681545654039?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/800433681545654039?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JamesJanuszka/~3/OydbmrSKSE8/echobot-now-living-at-bobsbasement.html" title="Echobot now living at Bobsbasement" /><author><name>Jims</name><uri>http://www.blogger.com/profile/11132506777555384693</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp0.blogger.com/__wNYCvyCDR0/SAZ1imxSxTI/AAAAAAAAAB4/qHmHZot4RCY/S220/n680692270_9067.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://jims-tech.blogspot.com/2008/05/echobot-now-living-at-bobsbasement.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEYCQ3c7fSp7ImA9WxdVE0U.&quot;"><id>tag:blogger.com,1999:blog-4721982885013708497.post-1238154087373962437</id><published>2008-05-06T11:45:00.003+01:00</published><updated>2008-07-18T14:02:42.905+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-18T14:02:42.905+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Echobot" /><category scheme="http://www.blogger.com/atom/ns#" term="Twitter" /><title>Echobot has moved</title><content type="html">I finally got my web host, &lt;a href="http://www.servage.net/?coupon=cust22522"&gt;Servage&lt;/a&gt;, to host Echobot. Now Echobot checks it's messages 24 hours a day 7 days a week. The only problem is instead of checking it's messages every 10 minutes, it now checks them hourly on the hour. I feel Echobot doesn't need real-time interactivity(whoa, Management speak 2.0!) so this should not be a problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4721982885013708497-1238154087373962437?l=jims-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/tZtx3ocpb68dzIq8-M5Xq5YyoU8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tZtx3ocpb68dzIq8-M5Xq5YyoU8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/tZtx3ocpb68dzIq8-M5Xq5YyoU8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tZtx3ocpb68dzIq8-M5Xq5YyoU8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/JamesJanuszka/~4/_YiRTubCjr4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jims-tech.blogspot.com/feeds/1238154087373962437/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://jims-tech.blogspot.com/2008/05/echobot-has-moved.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/1238154087373962437?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/1238154087373962437?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JamesJanuszka/~3/_YiRTubCjr4/echobot-has-moved.html" title="Echobot has moved" /><author><name>Jims</name><uri>http://www.blogger.com/profile/11132506777555384693</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp0.blogger.com/__wNYCvyCDR0/SAZ1imxSxTI/AAAAAAAAAB4/qHmHZot4RCY/S220/n680692270_9067.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://jims-tech.blogspot.com/2008/05/echobot-has-moved.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkYNQn07fyp7ImA9WxRQFE8.&quot;"><id>tag:blogger.com,1999:blog-4721982885013708497.post-1720102909709043438</id><published>2008-04-25T14:15:00.005+01:00</published><updated>2008-10-08T02:09:53.307+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-08T02:09:53.307+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Echobot" /><category scheme="http://www.blogger.com/atom/ns#" term="Twitter" /><title>Echobot is now in testing</title><content type="html">&lt;span style="font-weight: bold;"&gt;Echobot&lt;/span&gt; is a bot that I have written for twitter. It was written in PERL script. The way it works is, when you send it a direct message from twitter, it sends that message back to you. It might seem like a strange thing to do, but it has its uses.&lt;br /&gt;
&lt;br /&gt;
The main reason I wanted to create such a bot was that I wanted to send messages from my PC to my mobile phone, for example one day I was looking for the address of my nearest branch of a particular building society. When I found it on the internet I wanted to text that information to my phone, so when I got to London I knew what the address was. I'm sure there could be other uses for Echobot but we will have to wait and see.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;How to use Echobot&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
In order to use Echobot you have to follow it on twitter, and receive notifications from it on your mobile. Then I have to get it to follow you (I have yet to find a way to make it auto-follow people). Once that is setup all you have to do is sent it a direct message and it will send you it back.&lt;br /&gt;
&lt;br /&gt;
For example you would type this in the textbox on the twitter website&lt;br /&gt;
&lt;pre&gt;d echobot Hello how are you doing?&lt;/pre&gt;Currently Echobot checks its messages every ten minutes, and I am running it on my PC as a crontab. So Echobot is only awake whilst my PC is on.&lt;br /&gt;
&lt;br /&gt;
Here is the link for Echobots profile on twitter, &lt;a href="http://www.twitter.com/echobot"&gt;www.twitter.com/echobot.&lt;/a&gt;&lt;br /&gt;
I am currently setting up a home page for Echobot at &lt;a href="http://www.jamesjanuszka.com/content/echobot"&gt;www.jamesjanuszka.com/content/echobot&lt;/a&gt; Where you can also download the source code.&lt;br /&gt;
&lt;br /&gt;
I have also posted the code below&lt;br /&gt;
&lt;pre&gt;#!/usr/bin/perl -w
#
# Echobot - This bot echos back any tweets you send it
#
# James Januszka, 2008, http://echobot.trinician.com/ and
# http://jims-tech.blogspot.com
#
#    THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
#    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#    MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
#    DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS
#    BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
#    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
#    TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
#    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
#    ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
#    OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
#    OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
#    POSSIBILITY OF SUCH DAMAGE.
#
use strict;
use LWP;
use URI;

my $agent ='Echobot/0.1'; # Useragent
my $statusurl = 'http://twitter.com/statuses/update.xml'; # Url for sending updates to
my $repliesurl='http://twitter.com/direct_messages.xml'; # Url for direct message inbox
my $deleteurl='http://twitter.com/direct_messages/destroy/'; # Url to delete messages
my $server ='twitter.com:80'; # Twitter's Server name and port number for HTTP authentication
my $realm ="Twitter API"; # Twitter's Realm name for HTTP authentication
my $username = ""; # Your bots username for Twitter
my $password =""; # You bots password for Twitter
my $browser = LWP::UserAgent-&amp;gt;new(agent =&amp;gt;$agent);
$browser-&amp;gt;credentials($server,$realm,$username=&amp;gt;$password);

sub directmessage {
my ($greeting) = @_;
my $response =$browser-&amp;gt;post($statusurl,['status'=&amp;gt;$greeting]);
die "OMG, WTF: ",$response-&amp;gt;header('WWW-Authenticate'), $response-&amp;gt;status_line unless $response-&amp;gt;is_success;
}

sub getreplies{
my $response = $browser-&amp;gt;get($repliesurl);
die "OMG, WTF: Can't get $repliesurl --", $response-&amp;gt;status_line unless $response-&amp;gt;is_success;
if ($response-&amp;gt;content =~m/&lt;direct_message\b&gt;/) {
my @out = split(/&lt;direct_message&gt;/, $response-&amp;gt;content);
foreach (@out){
my $string = $1 if ($_=~ /&lt;text&gt;(.*?)&amp;lt;\/text&amp;gt;/s);
my $sender =$1 if ($_=~ /&lt;sender_screen_name&gt;(.*?)&amp;lt;\/sender_screen_name&amp;gt;/s);
my $id=$1 if ($_=~/&lt;id&gt;(.*?)&amp;lt;\/id&amp;gt;/s); 
$string = "d ".$sender." ".$string; 
&amp;amp;directmessage ("$string");
&amp;amp;deletemessage($id);
}
} else {print "No more messages. \n";}
}

sub deletemessage{
my ($message)=@_;
my $url=$deleteurl.$message.".xml"; # $deleteurl + message id number + .xml
my $response = $browser-&amp;gt;get($url);
die "OMG, WTF: Can't get $url --", $response-&amp;gt;status_line unless $response-&amp;gt;is_success;
}

getreplies();
&lt;/id&gt;&lt;/sender_screen_name&gt;&lt;/text&gt;&lt;/direct_message&gt;&lt;/direct_message\b&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4721982885013708497-1720102909709043438?l=jims-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/jnKD1fvtb4s1eCgkgTjEQrZG5CQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jnKD1fvtb4s1eCgkgTjEQrZG5CQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/jnKD1fvtb4s1eCgkgTjEQrZG5CQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jnKD1fvtb4s1eCgkgTjEQrZG5CQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/JamesJanuszka/~4/qC5mjPuQaF8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jims-tech.blogspot.com/feeds/1720102909709043438/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://jims-tech.blogspot.com/2008/04/echobot-is-now-in-testing.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/1720102909709043438?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/1720102909709043438?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JamesJanuszka/~3/qC5mjPuQaF8/echobot-is-now-in-testing.html" title="Echobot is now in testing" /><author><name>Jims</name><uri>http://www.blogger.com/profile/11132506777555384693</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp0.blogger.com/__wNYCvyCDR0/SAZ1imxSxTI/AAAAAAAAAB4/qHmHZot4RCY/S220/n680692270_9067.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://jims-tech.blogspot.com/2008/04/echobot-is-now-in-testing.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUcHRH8zeSp7ImA9WxZbGEo.&quot;"><id>tag:blogger.com,1999:blog-4721982885013708497.post-3411254074978117614</id><published>2008-04-21T23:19:00.006+01:00</published><updated>2008-04-22T15:03:55.181+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-04-22T15:03:55.181+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="TCE Website" /><title>Image Rotator 1.0</title><content type="html">I was working on the &lt;a href="http://www.thecafeexperience.com/"&gt;TCE Website&lt;/a&gt; today and the white space between the "nav bar" and the "contact us" section was looking empty.&lt;br /&gt;&lt;br /&gt;I thought it would be nice if visitors could have a random image each time they loaded a page, this would require a nice little PHP script I wrote called &lt;span style="font-weight: bold;"&gt;Image Rotator&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The way this works is thus, firstly you setup a directory containing a pool of images, then you give them the same filename with a key after it. For example image0.png, image1.png, image2.png ... The script then displays one of those images at random whenever it is executed.&lt;br /&gt;&lt;br /&gt;Now for the source&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;// Image Rotator 1.0&lt;br /&gt;// James Januszka 2008&lt;br /&gt;// http://jims-tech.blogspot.com&lt;br /&gt;&lt;br /&gt;// Variables&lt;br /&gt;$dir="images"; // Directory containing images&lt;br /&gt;$files = scandir($dir);&lt;br /&gt;$string = "sidepic"; // Prefix of each image&lt;br /&gt;$extention ="jpg"; // Image Filetype&lt;br /&gt;$alt = "Closeup of Food"; // Alt text for the image&lt;br /&gt;$width = 180; // Width of image in pixels&lt;br /&gt;$height = 250; // Height of image in pixels&lt;br /&gt;&lt;br /&gt;foreach ($files as $file) // Loop through each file in the directory&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if ($file=ereg($string, $file)) // Regular expression to see if the filename contains $string&lt;br /&gt;{&lt;br /&gt;$j =$j+1;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;$count = $j -1; // Ugly Hack; the rand() function generates a number between 0 and $count&lt;br /&gt;&lt;br /&gt;srand(time());&lt;br /&gt;$random = (rand()%$count);&lt;br /&gt;$image="$dir/$string$random.$extention"; // Generates a path to the image(directory+prefix+random+extention)&lt;br /&gt;echo("&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;*&lt;/span&gt;img src='$image' alt='$alt' width=$width height=$height&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;*&lt;/span&gt;"); //Displays image ;)&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; (*I had to remove the&lt;br /&gt;angle brackets from this line so blogger would display it!)&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It may look complicated at first, but its really simple. At the top of the code I define the variables used in the script, most of these are do to with the rendering of HTML code that displays the images. Next it scans through the image directory and builds an array containing the images, finally it displays an image at random.&lt;br /&gt;&lt;br /&gt;One of the cool things about the script is this routine;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;foreach ($files as $file) // Loop through each file in the directory&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if ($file=ereg($string, $file)) // Regular expression to see if the filename contains $string&lt;br /&gt;{&lt;br /&gt;$j =$j+1;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It scans through the directory and uses a regular expression to find and count how many files are prefixed with $string, ignoring all other files in the directory, it needs to know how many pictures there are for the pseudo-random generator to work.&lt;br /&gt;&lt;br /&gt;The final part of this script, shown below, generates a pseudo-random number and uses that to pick and display an image.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;srand(time());&lt;br /&gt;$random = (rand()%$count);&lt;br /&gt;$image="$dir/$string$random.$extention"; // Generates a path to the image(directory+prefix+random+extention)&lt;br /&gt;echo("&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;*&lt;/span&gt;img src='$image' alt='$alt' width=$width height=$height&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;*&lt;/span&gt;"); //Displays image ;)&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; (*I had to remove the&lt;br /&gt;angle brackets from this line so blogger would display it!)&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;Well thats the script, you are free to use it as you will, and you can make any changes that you desire, just as long as you credit me.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4721982885013708497-3411254074978117614?l=jims-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/xmpzk08CPTTmG11FA1xDBePc_7c/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xmpzk08CPTTmG11FA1xDBePc_7c/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/xmpzk08CPTTmG11FA1xDBePc_7c/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xmpzk08CPTTmG11FA1xDBePc_7c/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/JamesJanuszka/~4/CWHFm7R1H8E" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jims-tech.blogspot.com/feeds/3411254074978117614/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://jims-tech.blogspot.com/2008/04/image-rotator-10.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/3411254074978117614?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/3411254074978117614?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JamesJanuszka/~3/CWHFm7R1H8E/image-rotator-10.html" title="Image Rotator 1.0" /><author><name>Jims</name><uri>http://www.blogger.com/profile/11132506777555384693</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp0.blogger.com/__wNYCvyCDR0/SAZ1imxSxTI/AAAAAAAAAB4/qHmHZot4RCY/S220/n680692270_9067.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://jims-tech.blogspot.com/2008/04/image-rotator-10.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak4FQ3gzcCp7ImA9WxZbFE4.&quot;"><id>tag:blogger.com,1999:blog-4721982885013708497.post-8722994199382279684</id><published>2008-04-17T14:05:00.003+01:00</published><updated>2008-04-17T14:28:32.688+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-04-17T14:28:32.688+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Gadgets" /><title>Candle Printer</title><content type="html">I just came across an interesting product from China. Candle Printer Model UN-SO-M01. It's a printer that can print your own designs onto candles. It connects to your PC via a USB cable.&lt;br /&gt;&lt;br /&gt;This product is really going to appeal to the arts and crafts crowd, currently there are no importers of this or similar products in the West. Spotting a gap in the market, I approached Sinounic with a view to importing a few samples to flog on Ebay.&lt;br /&gt;&lt;br /&gt;The response I got was enthusiastic, they showed be some specs, and I must say I thought I had something pretty hot here. Everything was going fine until we came to the price, 1600USD per unit. Even if I negotiated it would still be ludicrous.&lt;br /&gt;&lt;br /&gt;Oh well I reckon the big boys are going to pick this up, and by Christmas it will be in all those crappy gadget booklets you get in the Sunday papers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4721982885013708497-8722994199382279684?l=jims-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/eED4kjK9T38rlG4yO-ftU3qxsVU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eED4kjK9T38rlG4yO-ftU3qxsVU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/eED4kjK9T38rlG4yO-ftU3qxsVU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eED4kjK9T38rlG4yO-ftU3qxsVU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/JamesJanuszka/~4/TbAEbcLEATg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jims-tech.blogspot.com/feeds/8722994199382279684/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://jims-tech.blogspot.com/2008/04/candle-printer.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/8722994199382279684?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/8722994199382279684?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JamesJanuszka/~3/TbAEbcLEATg/candle-printer.html" title="Candle Printer" /><author><name>Jims</name><uri>http://www.blogger.com/profile/11132506777555384693</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp0.blogger.com/__wNYCvyCDR0/SAZ1imxSxTI/AAAAAAAAAB4/qHmHZot4RCY/S220/n680692270_9067.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://jims-tech.blogspot.com/2008/04/candle-printer.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0QHRnk6eCp7ImA9WxZWF0U.&quot;"><id>tag:blogger.com,1999:blog-4721982885013708497.post-2520413767864744225</id><published>2008-03-17T18:55:00.004Z</published><updated>2008-03-17T19:15:37.710Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-03-17T19:15:37.710Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="TCE Website" /><title>TCE Website</title><content type="html">&lt;span style="font-family:arial;"&gt;I've just been asked to create a website for my fiancee's fathers catering business. I've got the first draft up on my server. It can be seen at &lt;a href="http://www.thecafeexperience.com/"&gt;www.thecafeexperience.com &lt;/a&gt;. I am going to be using HTML for the pages, but they will be saved as PHP files. This should give be a bit of flexibility, allowing me to include dynamic content, as well as logging visitors.&lt;br /&gt;&lt;br /&gt;Her father has asked me to include his menus in the website. This gives me an excuse to play with XML. What I will do is store the menus as XML files and I can use PHP, with CSS formating ;-) to generate the web page.&lt;br /&gt;&lt;br /&gt;Well heres a screeny showing the layout so far.&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/__wNYCvyCDR0/R97DAMxKW7I/AAAAAAAAABw/HNi2ldXmW1w/s1600-h/tce.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/__wNYCvyCDR0/R97DAMxKW7I/AAAAAAAAABw/HNi2ldXmW1w/s400/tce.jpg" alt="" id="BLOGGER_PHOTO_ID_5178791029717490610" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4721982885013708497-2520413767864744225?l=jims-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/YpA4URtbiYRhwKdnMrUVjAqLySA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YpA4URtbiYRhwKdnMrUVjAqLySA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/YpA4URtbiYRhwKdnMrUVjAqLySA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YpA4URtbiYRhwKdnMrUVjAqLySA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/JamesJanuszka/~4/be71Ay0v1kw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jims-tech.blogspot.com/feeds/2520413767864744225/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://jims-tech.blogspot.com/2008/03/tce-website.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/2520413767864744225?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/2520413767864744225?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JamesJanuszka/~3/be71Ay0v1kw/tce-website.html" title="TCE Website" /><author><name>Jims</name><uri>http://www.blogger.com/profile/11132506777555384693</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp0.blogger.com/__wNYCvyCDR0/SAZ1imxSxTI/AAAAAAAAAB4/qHmHZot4RCY/S220/n680692270_9067.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/__wNYCvyCDR0/R97DAMxKW7I/AAAAAAAAABw/HNi2ldXmW1w/s72-c/tce.jpg" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://jims-tech.blogspot.com/2008/03/tce-website.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUcNR3czcCp7ImA9WxZbGEo.&quot;"><id>tag:blogger.com,1999:blog-4721982885013708497.post-5691596142835082689</id><published>2007-12-22T18:59:00.002Z</published><updated>2008-04-22T15:04:56.988+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-04-22T15:04:56.988+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Project HTTPortscan" /><title>HTTPortscan 0.01</title><content type="html">Here is a simple script I made that when you give it an IP address it scans port 80, and tells you if the port is open or closed.&lt;br /&gt;&lt;br /&gt;Just copy the source into your favourite editor and away you go.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;#!/usr/bin/perl&lt;br /&gt;#httportscan.pl&lt;br /&gt;#Simple port scanner&lt;br /&gt;&lt;br /&gt;use IO::Socket;&lt;br /&gt;&lt;br /&gt;$sock = IO::Socket::INET-&gt;new("$ARGV[0]:80");&lt;br /&gt;&lt;br /&gt;if ($sock) {&lt;br /&gt;print "Port 80 is open \n";&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4721982885013708497-5691596142835082689?l=jims-tech.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Dn0kIbumAk35OEPAz9rQxPq0-e0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Dn0kIbumAk35OEPAz9rQxPq0-e0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Dn0kIbumAk35OEPAz9rQxPq0-e0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Dn0kIbumAk35OEPAz9rQxPq0-e0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/JamesJanuszka/~4/3vY7cDoNE7Q" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://jims-tech.blogspot.com/feeds/5691596142835082689/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://jims-tech.blogspot.com/2007/12/httportscan-001.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/5691596142835082689?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4721982885013708497/posts/default/5691596142835082689?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/JamesJanuszka/~3/3vY7cDoNE7Q/httportscan-001.html" title="HTTPortscan 0.01" /><author><name>Jims</name><uri>http://www.blogger.com/profile/11132506777555384693</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://bp0.blogger.com/__wNYCvyCDR0/SAZ1imxSxTI/AAAAAAAAAB4/qHmHZot4RCY/S220/n680692270_9067.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://jims-tech.blogspot.com/2007/12/httportscan-001.html</feedburner:origLink></entry></feed>

