Windows Mobile + Twitter / Facebook = UltraStalk Hack

Well, I have done it. I have managed to bridge that gap between my computer and my toilet… or my computer and my drive to work… or my computer and those boring lectures at school…. I no longer have to suffer through the pain of not having access to my live feed of everyones life. I can now continue my daily stalk even when I am not at my computer.

If you are like me, you have your Facebook status update feed for all of your friends in your favorite feed reader and set it to update every 1 minute. You also added your friend’s Twitter feeds. You may have even taken advantage of Facebooks SMS notification feature, where it txt-msgs you whenever a friend updates their status… Well, that was not good enough for me, and only provided me with limited info on a few people… I wanted INSTANT access to my Facebook/Twitter stalking resources!

So, I found a way. I own a Motorola Q, and I love it. Despite all of the problems everyone has with it and what everyone says, I find it to be the most useful mobile tool I have. I watch TV on it (SlingBox + Comcast Digital Cable), listen to music on it (SiriusWM5 for Sirius, and Orb for mp3s from my large library on my desktop PC), play SNES games on it (thank you PocketNesterPlus), use it for GPS navigation & phone book (Windows Live Search), instant message from it (Agile Messenger), and of course that phone/email/web thing as well. I WANTED MORE!

I wanted to move my obsessive Facebook/Twitter habits into my mobile lifestyle so I could stalk on the go. Here is my solution:

ss000.jpg

Notice the information that I circled in red. This the latest Facebook update from my entire set of friends. “Katie S. is on her way to target.” My homescreen is updated every 3 minutes with the latest status update from Facebook. Whenever someone updates their status, my phone makes a very light noise and the update is displayed on my home screen. ULTRASTALK! I see all and hear all now.

And now, here is how it works. I found a scripting language that works on mobile phones and has a nice set of functions and features. It is called MortScript. MortScript has the ability to read/write to the registry, download and read files from the internet, automatically run at specified intervals, etc etc etc… I created a very simple script that checks a PHP file on a server of mine, and saves the information to the phone. Then I added a built-in plugin to the home screen that displays that information. I currently only have it doing a live Facebook status update, but the PHP script could easily be made to pull Twitter, or even BOTH. This MortSCript is only for displaying the information, so really, the PHP script could grab ANY type of information, such as: server status, new email, feed updates (such as facebook/twitter), IM presence information, number of users on your website, new comments on your blog, important alerts (like a pager?). Really, I have created the framework for any type of instant mobile alerts.

MortScript:

scriptURL = "URL_TO_YOUR_SCRIPT"
ThisScriptPath = SystemPath("ScriptPath")
ThisScriptName = SystemPath("ScriptName") & SystemPath("ScriptExt")
 
#Update interval in seconds, 180 = 3 minutes.
UpdateInterval = 180
 
Call SetUpdateTime
 
#Turn Errors OFF
ErrorLevel("off")
 
Contents = ""
wURL = scriptURL
Contents = ReadFile(wURL)
OldContents = RegRead ("HKCU","ControlPanelOwner","Notes")
 
If (OldContents ne Contents)
	#For the Q
	RegWriteString ("HKCU","ControlPanelOwner","Notes", Contents)
 
	#Uncomment the following and change filename to play a sound
	#PlaySound("NewUpdate.wav")
EndIf
 
Exit
# -------------------------------------------------------------
Sub SetUpdateTime
If (UpdateInterval <> 0)
	RunAtTime = TimeStamp() + (UpdateInterval)
 
	#Remove the Notification Queue (if exists)
	RemoveNotifications(ThisScriptPath & "\" & ThisScriptName)
 
	#Set the Notification Queue Item
	RunAt(RunAtTime, ThisScriptPath & "\" & ThisScriptName)
EndIf
EndSub

PHP Script

$url = 'FACEBOOK_STATUS_FEED_URL';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0");
$xml = curl_exec($ch);
curl_close($ch);
 
$xmlobj = simplexml_load_string($xml);
$status = $xmlobj->channel->item[0]->title;
$author = $xmlobj->channel->item[0]->author;
$authorn = split(' ',$author);
 
switch(count($authorn)):
case 1: // single name
    $authorabbr = $authorn[0];
    break;
case 2: // first &amp; last name
    $authorabbr = $authorn[0].' '.$authorn[1]{0}.'.';
    break;
case 3: // first middle last, take first and last
case 4: // first middle last sr/jr/III, take first and last
    $authorabbr = $authorn[0].' '.$authorn[2]{0}.'.';
    break;
default:
    $authorabbr = 'Someone';
    break;
endswitch;
 
$status = str_replace($author, ucwords($authorabbr), $status);
 
echo $status;
?>

XML to add to your home screen file:

<plugin clsid="{4824B576-EFFE-45cf-BAE9-649B930CD244}" height="23">
	<background b-border-width="0"></background>
	<label halign="left" h="20" x="38" y="0" w="275" font-size="15" padding-right="0">
		<text><notes></notes>
       	</text></label>
</plugin>

You will obviously need to customize the XML to suite your current home screen needs (x,y,height,width,font-size, etc etc). Follow this link to download MortScript and install it. Name the script above ultrastalk.mscr and run it from filemanager to start it. If anyone is actually interested in using this, just leave a comment and I will post a follow up with step-by-step instructions.

8 Responses to “Windows Mobile + Twitter / Facebook = UltraStalk Hack”


  1. 1 Katie

    Love ya :) geek

  2. 2 scott

    hey, so…..this isn’t working for me on my samsung blackjack and I followed your instructions. Does the php file end in .php (obviously)? Confusing!

  3. 3 lasse

    Okay, never really been interested in twitter at all. However, I noticed that you like facebook and PHP. Similar to me really.. Could you write a php script to edit every aspect of facebook and recieve updates? Just a small snippet with the most vital of things… If you could manage that and post your code I could port it into a Firefox widget. idalatob[at]yahoo[dot]co[dot]za

  4. 4 Jon

    Nice, this would also work well for getting the current weather instead of using Fizz weather..

  5. 5 Jon

    So I got everything else working but the registry value isn’t displaying on my homescreen, are you using a plugin to display it? Thanks.

  6. 6 Christian Flickinger

    It is a standard windows mobile plugin (built in). The 3rd box above has the plugin xml to put in your homescreen xml file.

    Are you using WM5 or WM6?

  7. 7 jon

    Thanks for the comment, I copied the xml code just like i would with any other HS. Moto Q on WM5. is there a differnace between 5 and 6?

  1. 1 Life, it is a Travesty… » links for 2007-04-27

Leave a Reply