TwitPic and Rogers

by Brian on 3/1/2009

twitpic logo Rogers Logo

Since I do not own an iPhone, and since Rogers Wireless in Canada has a weird way of handling image MMS messages, I spent a few hours this weekend creating a Python script to properly parse Rogers Wireless MMS emails.  There are a few things Rogers does that makes sending MMS messages to TwitPic impossible:

  1. They attach a second “VeriSign” jpeg to the email which often gets chosen by TwitPic as the image to post.
  2. The subject of the email message from Rogers says something like, “You have received an MMS message from YOURCELLPHONENUMBER.”  Most of us don’t like our cell phones numbers posted on Twitter. :)  The original subject of the MMS is actually included on a website linked to in the email.

So to compensate for these weird Rogers quirks my script will:

  1. Extract the proper JPEG from the email (it verifies that it didn’t take the VeriSign JPEG by comparing the JPEG to an MD5 hash of the VeriSign JPEG).
  2. Grabs the proper subject by going to the Rogers website linked to in the email.
  3. Uses the TwitPic API to upload the JPEG and message to TwitPic.

You can find the source code here.  You will need a mail server that can pipe email messages to the script.  If you have a Linux box with a public IP address, chances are you have everything you need.  If there’s a lot of interest in this script, I will look into writing a tutorial on how to set it up, or if most people think this is too hard in general, then I may also look into getting it hosted on a server for everyone to use.

Please post a comment if you try the script out, if interests you at all, or if you want it hosted somewhere for you to use.

UPDATE: This script requires Python >= 2.5 because it uses email.feedparser.  On some machine, you may need to call Python by using python25 to ensure version 2.5 is used.  And if you’re using Ubuntu or Debian, install the python25 package.

Related posts:

  1. Python Telnet Code
  2. Complicated Elections
  3. Amazon
  4. Default Timeouts in Python urllib2
  5. Free Wireless in Seattle Coffeehouse
  • Laura
    I know little to nothing about computers, could you consider writing a really simple tutorial? Like, tools > options > advanced....etc. In that sort of format. I've been having this issue and I can't find ANYTHING to fix it! I've even tried calling and talking online with a Rogers representative. Nobody can help me!
  • Zakk
    For a complete list of apps, go here, and search of the word Java: http://www.squidoo.com/twitterapps - most of the Java apps will work on any phone, and will use data service to upload the photo so you don't need to use MMS or email or SMS. Works like a charm!
  • Zakk
    I found another way to do it: http://www.twibble.de
  • Zakk
    I finally figured out a way to post pictures and tweets with Rogers. Here: http://twitxr.com - it has an upload form that you can access in the web browser on your cell phone, use that to upload photos and tweet, it then syncs with Twitter. Three days of searching..finally figured it out!
  • Name
    This would also be pretty beneficial to Fido users as well~
  • takatsu
    on the side thought. Is it possible to host it somewhere for everyone to use? There are alot of Rogers users in Canada who will have the same problem =) It would be AWESOME if someone could do that.
  • karen
    i admit, most of that was greek to me, but that's irrelevant since i'm a windows user. i would love to be able to send twitpics on rogers, though - so frustrating!
  • They still haven't fixed support for it yet?
  • sam
    so sad for windows users
  • Matt C
    Hey Brian,
    This script looks like it would be great to setup.
    Do you have a tutorial on how I can set this up. I'm a web developer, and have my own ubuntu server to set this up on, I'm just not sure exactly how to set it up. Any pointers would be great.
  • Hey Matt,

    I'll try to give you some pointers. I guess step one would be to get the python script setup some where on your server. You should be able to run the script without it producing any errors (when it's run, it should just sit there and do nothing because it's waiting for input from the stdin, hit ctrl+c to exit). Once it runs without any errors, the easiest to get the script to process emails is to have your alias file in /etc/alias pipe emails to the script by adding a line like:

    twitpic-356:"|python /path/to/script/twitpic_rogers/twit_email.py"

    Do you have a mail server setup on your server, and is it receiving mail? What mail server are you using?

    Brian.
  • Matt C
    Hi Brian,
    I actually don't have a mail server setup and I wasn't thinking clearly when I thought I could set it up. I don't believe it will work. My server is just a home server connected through my normal cogeco internet, so port 25 is blocked, therefore, no mail.
    I guess I would need to get access to a server that can support mail before I can get this working for me. Hopefully I can, since this functionality would be great in order to bypass the way rogers sends pictures messages...
  • Does cogeco block incoming port 25 connections, or just outgoing port 25 connections? I think that if they only block outgoing port 25 connections, then it probably should still work. You can use something like dyndns.org to get a dynamic DNS to use (although cable connection usually have a fairly static IP).

    Brian.
  • Matt C
    Cogeco blocks incoming port 25 on non-business accounts.
    I was thinking of maybe writing an outlook script that could run the python code or failing that, write a vb script that would do the same as this python script. Just not sure how to do it yet...
  • They're sneaky. :)
  • Matt C
    Just thought I'd let you guys know I wrote a VBA script that runs on incoming messages in outlook.
    It will grab the subject and image and send them as a new email to your twitpic account. It also grabs the large version of the image stored by rogers and sends that one.
    Thanks for the inspiration of your python script! :-D

    If I might make one suggestion to your python script, is that you also grab the large image. you can get to it by following the href of a link with the name img0 then grab the image from the corresponding page. Just my 2 cents.

    Thanks again for the inspiration, and if anyone would like the vba script let me know.
    Thanks,
    Matt
  • Not sure if you'll still get this message since your comment is 9 months old but I would love to have the vba script...
  • takatsu
    I also have the same problem with the Rogers MMS. Twitpic is still not working with the MMS. is this only a Linux thing? How do you set it up on windows?

    @Matt C, How do you set up the script for outlook?

    Thanks
blog comments powered by Disqus

Previous post:

Next post: