[General ] 10 October, 2009 18:37

Windows are in - going to install them - wish me luck (I've never done this before).  This should be fun, I don't get to walk around on the roof a whole lot now that I have to be a responsible dad and all that crap.

[General ] 07 October, 2009 11:14

Facebook - you dirty rat!  Where is Michelle's profile gone??!!!???

ACCOUNT DISABLED!!???!Yell

[General , Videos ] 04 October, 2009 10:25

We got in last night at 12:30am (so... that would be this morning, then, right?).  The trip out was fantastic.  The boys were great in the car.

On the way home, however, Cameron just had enough and wanted  (More)

[General ] 03 October, 2009 02:51

Tomorrow we are heading into Chatham to visit friends family.

It is approximately three and a half hours one way.  So, we have about 7 hours in the car ahead of us.  Neither of the boys have had to sit in the car that long without breaks, so this will be an experience. (More)

[Programming ] 30 September, 2009 22:38

I've been getting a lot of interest in the automatic Twitters I have set up.  People are curious how I've done it and what it is about.

update:  the link to the feed is http://twitter.com/fortune_mod


Basically, I set up an automatic twitter every half hour, Monday to Friday between 9am and 5pm.  These tweets are from a linux/unix program written by many people over the years called Fortune.

Fortune is a simple program which pulls random entries from a database of quotes, sayings, or anything else of trivial importance.  I believe the original intent of the program was to provide a fortune cookie for users who logged into a computer or other similar activity.  Over the years I have seen it used more as being a generator for tag lines in emails than anything else.  Each time an email is sent, a new fortune is used as the tag line at the bottom of emails.  There are many tutorials available to get this working on many email clients.

I was looking into the programmer's interface that is supplied by the folks at Twitter and wanted to set up an automatic twitter.  I am using fortune mainly because it's readily available.  I decided to write a simple PHP script that would call fortune, and use the returned text as the source of a posted tweet.  Here is the code:


// Auto Twitter feed
$message = shell_exec('fortune -s -n 140'); // Get a fortune that is less than 140 characters long
$message = urlencode($message); // encode the message to pass to Twitter
$curl_handle = curl_init(); 
curl_setopt($curl_handle, CURLOPT_URL, 'http://twitter.com/statuses /update.xml');
// Set to use the XML interface
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_POST, 1); // POST instead of GET
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, \"source=$source&status=$message\" ) ; 
curl_setopt($curl_handle, CURLOPT_USERPWD, $USER_NAME . ':' . $PASSWORD);
$buffer = curl_exec($curl_handle); // Send the tweet
curl_close($curl_handle); // Clean up


The next step is to add a cron job which would run the PHP script every half hour.  Cron is a program which runs every minute and looks at a table of entries to determine if there are any applications, scripts or processes that should be run.  Using Cron, you can make programs run automatically at different times, daily, weekly, monthly or every other day even.  For this, I want it to run every half hour only durning business hours.  Here is the cron entry:

*/30 9,10,11,12,13,14,15,16,17 * * * /usr/bin/php ~/twitter.php

 

Hope this helps!

[General ] 30 September, 2009 00:32

Having a discussion the other day with a good friend we came across the word manipulate.  This is a word which in the context of getting other people to do what we want - has a negative connotation attached.  Don't get me wrong here - I don't want to loose the bad press that word has received - but I also don't want to avoid it.

If we intend to try to convince someone of doing something they normally won't do or intended to do - that is manipulation.  What our intentions are - that is where malice can lie. (More)

[General ] 29 September, 2009 17:48

Michelle and I have been discussing what we have to do to winterize our house.

We have four old windows and I'd say 2 1/2 doors that have to be replaced.  The half door is actually an interior door that goes to the mud room out front - which isn't very well insulated, so I think it should be a proper outside door.

With the tax break, we've decided to do the most important ones - the boy's windows.  So this year we are getting two new windows. 

I - for the first time in my life - went window shopping!

That's it.  That's all I wanted to blog about - all that for that dumb punchline.  Aren't you glad you waste your time here?

[General ] 29 September, 2009 01:59

Okay - so...  I'm a geek.

I spend my time trying to get my website to automatically post tweets - and now update my status on Facebook.

If you got here from my face status - then this time has been well spent.  ;)

«Previous   1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16  Next»