Jump to content
Sign in to follow this  
Strawp

mobile.strawp.net debugging

Recommended Posts

This weekend I created a script which can recieve MMS messages and cross-post them onto any thread in this forum. Due to quirks with how various mobile networks think they should handle MMS messages, I'm going through a process of learning and debugging to make it work in as many ways as possible.

To Register

Send an MMS to register@mobile.strawp.net with your forum user ID in the body. Your user ID is the number after "showuser=" in the URL of the page when you're viewing your profile. e.g. mine is 504. Click on my name there on the left and you can see that number at the end of the URL.

Once you've sent the MMS, you will get a PM from "Ansel Bleedin' Adams" with a URL that you need to visit to activate your account. Once you've done that, another PM will tell you about how to post messages to threads.

Known working networks

These are networks whose MMS format my thing can handle.

  • Orange
  • O2
  • Three (seems to be working OK now, time and more messages will tell)
  • T-Mobile
  • Vodafone

Networks that we haven't tested yet (sign up!)

  • Virgin

Networks which definitely don't work (yet)

None that I know of yet...

If you're not in these lists I'd appreciate an MMS from you just to see what format it arrives in.

If/when this thing is totally working I will delete this thread.

Overseas people:

It shouldn't matter that you're not in the UK. In fact I'd like someone on a non-UK network to try this out if possible.

Share this post


Link to post
Share on other sites

If you want to post into this thread via MMS, the address is debug@mobile.strawp.net

Damn 3, they use the O2 network for some stuff so I was hopeful.

Yeah, but they wrap the tiny little 5 character text body in about 200 lines of HTML and then leave a flat text part which says "Use a graphic mail client, LOL".

If I sent it to your inbox does that mean you saw my pic?

It's OK, I've seen you in a state of undress before :)

Share this post


Link to post
Share on other sites

Ok so where is the user ID?

Edit: Found it, for anyone who can't see it. Highlight your name in the "members reading this topic" box and you'll get the number.

Share this post


Link to post
Share on other sites

Right, just sent one MMS (to register) from my phone (V3x on the 3 network), didn't work last time (Tuesday), so we shall see...

EDIT!

Got the PM message, so it seems to have worked... Sending a test photo now

Share this post


Link to post
Share on other sites

Yeah, Three attaches a shite load of other images to messages and wraps the text in massive amounts of HTML. Maybe I'll just have to have Three users only take the first image out of each message. I've built it so that you can add as many images to a message as you like otherwise.

It didn't work before because I didn't catch your message. The script didn't understand it and threw it out. Since then I've had one from redbloodcell who's also on Three and worked something out for it.

I sent a registration from one of my mates phones which is on T-Mobile. That doesn't even encode in flat text. I think I'm going to spend some time tomorrow working how the feck to read that puppy in.

Share this post


Link to post
Share on other sites

Out of curiosity, would you be able to make the photos automatically resize for the forum (so input a set height and width for them)?

Share this post


Link to post
Share on other sites

That should be simple enough, better to use a percentage size rather than specific dimensions though, other wise images could be squashed depending on orientation.

Share this post


Link to post
Share on other sites

I was probably going to do that, yes - you Three users with your megapixel cameras!

What's a good maximum width? When I post photos off my site I tend to have them 800px across max.

I've set the thing for the moment so that only one image per MMS can be saved off. This does rely on the first image in the message being your photo though. I hope to find a better way of defining what is a photo and what isn't.

Edit: No, that was a silly idea. I'll work something else out.

Share this post


Link to post
Share on other sites

My W800 resizes images automatically if i'm putting it in a MMS ;)

Does it send out a much smaller image than you'd taken?

Vodaphone: I'll have a look. Doesn't look like it's recognised your message, goldbricker.

Edit: Looks like Vodafone does the exact same thing as Three does. I'm going to take your text and register you now.

Share this post


Link to post
Share on other sites

It should be noted, in case any of you are readying weapons, that I didn't post the massive amount of photos above :(

No, that was me ;)

Currently I'm dumping all recieved messages to text so that I can catch ones that don't get parsed properly yet and so I can go back put them through the script again when I've made changes.

That lot was me making the script ignore all the buttons and logos that get added to Three messages and then doing the resize ;)

Share this post


Link to post
Share on other sites

Strawp you rock.. I want to get my old camera phone fixed now just to use this.

How does it all work? it would be pretty cool to have a version of it for another forum I use.

Dude, it's extensible. I can quite feasibly add other addresses which relate to threads elsewhere on the internet. If the other forum is also based on Invision then that's very little work.

How it works:

There's a catch-all on mobile.strawp.net for email which pipes it all through a PHP script. If you send to register@ then it checks for an ID. If it finds one it adds a stub row into the user table with that ID in it (and the address that the MMS came from). For all other addresses it checks that the sender is registered and then saves the message to database and any images to the website. If the "To:" address matches a pre-defined address, the messages are added to a queue for posting to the forum that relates to that thread.

The other half of it is a script which runs every 5 minutes. This looks to see if there are any users waiting for their logins to be authorised. It finds out the forum username belonging to the ID that was entered and then sends them a PM through the forum with an activation code in it. It also looks to see if there are any messages waiting to be posted and posts each one in turn to the forum with the associated image, user details etc.

The web site just does basic selects from the stuff that's already in there.

Slightly more techy info:

I wrote 3 PHP classes which are used in this

  • A browser emulation class, which does HTTP transactions and remembers session cookies so you can log on to places
  • An Invision forum class which extends the above to give functions like sendPm() doLogin() and addReply()
  • A mime email class which uses the PEAR mime email decoder, but has added code for treating emails from mobile networks. Has things like saveImages() and getText() in it.

Alan's expressed interest in the Invision class for trusted traders (which I'll admit I know nothing about), so there are other benefits to my toils hopefully.

Share this post


Link to post
Share on other sites

Dude, it's extensible. I can quite feasibly add other addresses which relate to threads elsewhere on the internet. If the other forum is also based on Invision then that's very little work.

How it works:

There's a catch-all on mobile.strawp.net for email which pipes it all through a PHP script. If you send to register@ then it checks for an ID. If it finds one it adds a stub row into the user table with that ID in it (and the address that the MMS came from). For all other addresses it checks that the sender is registered and then saves the message to database and any images to the website. If the "To:" address matches a pre-defined address, the messages are added to a queue for posting to the forum that relates to that thread.

The other half of it is a script which runs every 5 minutes. This looks to see if there are any users waiting for their logins to be authorised. It finds out the forum username belonging to the ID that was entered and then sends them a PM through the forum with an activation code in it. It also looks to see if there are any messages waiting to be posted and posts each one in turn to the forum with the associated image, user details etc.

The web site just does basic selects from the stuff that's already in there.

Slightly more techy info:

I wrote 3 PHP classes which are used in this

  • A browser emulation class, which does HTTP transactions and remembers session cookies so you can log on to places
  • An Invision forum class which extends the above to give functions like sendPm() doLogin() and addReply()
  • A mime email class which uses the PEAR mime email decoder, but has added code for treating emails from mobile networks. Has things like saveImages() and getText() in it.

Alan's expressed interest in the Invision class for trusted traders (which I'll admit I know nothing about), so there are other benefits to my toils hopefully.

Thanks for the explanation...

Its pretty sweet.. the actual website part of it could easily be marketable as a commercial site..

How difficult would it be to make it work with VBB aswell as invision? and would it be possible to set the thread it posts to on the users specific moblog page?

i.e.. you could log onto your moblog page on your psp, enter the thread link, save it.. then send the message from your phone and see it pop up in the thread..

I'm thinking this could be a well easy way for people to get their phone pics onto forums, currently theres no commercial method for doing this which is easy to use..

Share this post


Link to post
Share on other sites

I need to come up with a convention for email addresses really, [username].[threadshortcut]@ maybe. The users could log on and define their own lists of forum shortcuts then.

There's nothing stopping me from having the site log in as a specific user if the user wants to supply their password, however I would of course need to be storing their username and password in plain text in the database.

I've not looked at VBB yet but I suspect it'd be easier to create a class for than Invision PB.

Share this post


Link to post
Share on other sites

Just thinking - It's very easy for me to log in as a different user to make posts. I could have the option of people logging in and posting under their own usernames, but this would mean that their username and passwords would be stored in my database.

Reckon anyone would want that if I did it?

Share this post


Link to post
Share on other sites

Just thinking - It's very easy for me to log in as a different user to make posts. I could have the option of people logging in and posting under their own usernames, but this would mean that their username and passwords would be stored in my database.

Reckon anyone would want that if I did it?

You keep saying this.. Maybe if people had a second username, for example Gazs_pics, Strawps_pics ??

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Use of this website is subject to our Privacy Policy, Terms of Use, and Guidelines.