Why my iPhone sucks: Screen Scraping the O2 Website - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

Why my iPhone sucks: Screen Scraping the O2 Website

Description:

Observations about the iPhone. Why Screen Scrape? MMS solution. Conclusions. Good Points ... Receiving MMS via Email. Conclusions. CPAN had all the modules ... – PowerPoint PPT presentation

Number of Views:68
Avg rating:3.0/5.0
Slides: 19
Provided by: simon120
Category:

less

Transcript and Presenter's Notes

Title: Why my iPhone sucks: Screen Scraping the O2 Website


1
Why my iPhone sucksScreen Scraping the O2
Website
  • Simon Lewis
  • http//lewis.li - simon_at_lewis.li

2
Overview
  • Observations about the iPhone
  • Why Screen Scrape?
  • MMS solution
  • Conclusions

3
Good Points(Before the Bashing)
  • Web Browser
  • SSL IMAP Email Client
  • Alarm Clock
  • Timer

4
Bad Points
(Camera, Phone Interface, Text Message
Interface)
  • EDGE
  • Bluetooth
  • NO 3G

Wet piece of string is better connected
5
MMS?
(maybe its not that popular)
ERROR
6
Mocking from O2
7
Message List Window
8
Beautiful Interface?
9
There must be a better Solution...
Problems
  • No web service available
  • http//o2.co.uk/m not optimised for iPhone

Opportunities
  • HTTP interface can be exploited
  • iPhone Mail app is very nice SSL IMAP

10
Screen Scraping?
  • Programmatically accessing webpage content
  • Parsing the contents of the page to extract the
    information you want
  • Need a language suited to text parsing

Laziness - one of the principle virtues of a
programmer What tools are available?
Perl
11
CPAN(Comprehensive Perl Archive Network)
use ConfigIniFilesuse WWWMechanizeuse
GetoptLonguse MIMELiteuse YAML qw(LoadFile
DumpFile)use DataDumperuse CGI qw(standard)
12
System Overview
2
5
lewis.li
iPhone
4
1
3
o2.co.uk
13
Authentication
my mech WWWMechanize-gtnew( autocheck gt 1
) mech-gtget( site_url )mech-gtsubmit_form(
form_name gt 'fm', fields gt msisdn gt
user_name, pin gt user_password )
14
Inbox Listing
mech-gtcontent /From.?ltpgt(.?)lt\/pgt.?Subjec
t.?ltpgt(.?)lt\/pgt/s my _at_mms_message_links
mech-gtfind_all_links( url_regex gt
qr/showMessage/ ) my unique_mms_links map
_, 1 map _-gturl_abs
_at_mms_message_links
15
Iterating through MMS
for my option (_at_other_options)
mech-gtcurrent_form-gtvalue('selectedItem',
option) mech-gtsubmit() filename
"/tmp/mmsmessage_part" open fh, "gt filename"
or die "filename !" binmode fh print fh
mech-gtcontent close fh mms_details-gtfile
name mech-gtct() mech-gtback()
16
Creating the Email
my msg MIMELite-gtnew( From gt"sender",
To gt"mail_recipient", Subject
gt"subject", Type gt'multipart/mixed')
for my part (keys mms_details) ( my
nice_name part) s!/tmp/!! if
(mms_details-gtpart eq 'image/jpeg')
msg-gtattach(Type gt'image/jpeg',
Path gt part,
Filename gt"nice_name.jpeg",
Disposition gt 'attachment') msg-gtsend
17
Receiving MMS via Email
18
Conclusions
  • CPAN had all the modules needed to automate
    interaction
  • Messages on the O2 website expire. Email
    provides a good way to archive content
  • WWWMechanize is very useful
  • Radio buttons were the biggest challenge
Write a Comment
User Comments (0)
About PowerShow.com