tylerhall / sosumi
- Source
- Commits
- Network (7)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
Pledgie Donations
Once activated, we'll place the following badge in your repository's detail box:
A MobileMe web scraper that exposes Apple's Find My iPhone service to the command line. This allows you to programmatically retrieve your phone's current location and push messages (and an optional alarm) to the remote device. — Read more
-
Multiple iphones on same mobileme account how to get info
1 comment Created 2 months ago by akrallHow do I pass the deviceid to locate when trying to select a particular iphone from a multiple iphones mobileme account?
Comments
-
When trying the example cron script, I get the following backtrace:
Fatal error: Uncaught exception 'Exception' with message 'Error during POST of 'https://secure.me.com/device_mgmt/en': Failed to open/read local data from file/application' in /home/user/dev/sosumi/class.sosumi.php:221
Stack trace:
0 /home/user/dev/sosumi/class.sosumi.php(148): Sosumi->curlPost('https://secure....', NULL, 'https://secure....', Array)
1 /home/user/dev/sosumi/class.sosumi.php(51): Sosumi->getDevices()
2 /home/user/dev/sosumi/foo.php(16): Sosumi->__construct('myuser', 'mypass')
3 {main}
thrown in /home/user/dev/sosumi/class.sosumi.php on line 221PHP = 5.2.4
libcurl3 = 7.18.0
Comments
I'm unable to reproduce this running the same version of curl and PHP 5.3.0. Any other data you can give me to help debug?
When I turn on verbose for curl, here's what I get (with a few cookie values obscured):
- About to connect() to secure.me.com port 443 (#0)
- Trying 17.250.248.137... * connected
- Connected to secure.me.com (17.250.248.137) port 443 (#0)
- successfully set certificate verify locations:
- CAfile: none CApath: /etc/ssl/certs
- SSL connection using RC4-MD5
- Server certificate:
subject: /1.3.6.1.4.1.311.60.2.1.3=US/1.3.6.1.4.1.311.60.2.1.2=California/2.5.4.15=V1.0, Clause 5.(b)/serialNumber=C0806592/C=US/postalCode=95014/ST=California/L=Cupertino/streetAddress=1 Infinite Loop/O=Apple Inc./OU=Internet Services/CN=secure.me.comstart date: 2009-06-30 00:00:00 GMTexpire date: 2011-03-22 23:59:59 GMTcommon name: secure.me.com (matched)issuer: /C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=Terms of use at https://www.verisign.com/rpa (c)06/CN=VeriSign Class 3 Extended Validation SSL SGC CASSL certificate verify ok.
POST /device_mgmt/en HTTP/1.1 User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_1; en-us) AppleWebKit/531.9 (KHTML, like Gecko) Version/4.0.3 Safari/531.9
Host: secure.me.com
Referer: https://secure.me.com/account/
Cookie: NSC_bddpvou.xpb-wjq=445ea1281062; aic=xxxxxxxxxxxxg==; isc-secure.me.com=xxxxxxxxxxxxxxx; al-acl=y; mmi=lang=en:tz=222:calstatus=0:webmailclientpref=3.0; mmr=n10; mma-account=
Accept: text/javascript, text/html, application/xml, text/xml, /
X-Requested-With: XMLHttpRequest
X-Prototype-Version: 1.6.0.3
X-Mobileme-Version: 1.0
X-Mobileme-Isc: xxxxxxxxxxx
Content-Length: 0
Content-Type: application/x-www-form-urlencodedClosing connection #0
- Failed to open/read local data from file/application
Fatal error: Uncaught exception 'Exception' with message 'Error during POST of 'https://secure.me.com/device_mgmt/en': Failed to open/read local data from file/application' in /home/panthar/dev/sosumi/class.sosumi.php:221
If it's hard to read here, I can put any debug info you need into pastebin
Looks like the github markup had some fun with it - here it is in pastebin:
http://panthar.pastebin.com/m7849b94aI found it! Inside class.sosumi.php:
Line 148:
$html = $this->curlPost('https://secure.me.com/device_mgmt/en', null, 'https://secure.me.com/account/', $headers);I changed the null to an empty string (''), and did the same to line 155.
I did some reading on similar curl errors and found that (this may have been updated in your PHP 5.3) it needs to pass something to POST, even an empty string. A null was killing it.
-
A seperate icon for "find my iPhone". Sosumi dont't work any longer :-(
Comments
-
I've discovered an issue when running this on the latest stable Debian or Ubuntu, which both have PHP 5.2 and a somewhat older cURL module installed. Other people are seeing this as well: http://nat.org/blog/2009/08/playnice-google-apple/comment-page-1/#comment-4887
Can you please narrow this down?Comments
I also have problems when trying this on my ISS6+PHP v5.2.6.
Fetching iPhone location...
Notice: Undefined index: secure.me.com in D:\web\mysite.com\findmyiphone\class.sosumi.php on line 141Notice: Undefined index: secure.me.com in D:\web\ mysite.com\findmyiphone\class.sosumi.php on line 148
Notice: Undefined index: secure.me.com in D:\web\ mysite.com\findmyiphone\class.sosumi.php on line 88
What can I do about it ?
-
Hi,
I get no output from the scraper when I use the simple example. I've spent a few hours trying to get this to work with no luck. The best I can figure is that it's dieing around line 49 in class.sosumi.php when it tries to fetch the URL "https://secure.me.com/wo/WebObjects/DockStatus.woa/wa/trampolinehttps://auth.apple.com/authenticate" (the value of $trampoline). If I go to "https://secure.me.com/wo/WebObjects/DockStatus.woa/wa/trampoline" in my browser when I'm authenticated, I just get a 404 page. Any hints? Thanks,
Doug
Comments
Actually it looks like my real issue is going to this URL: "https://secure.me.com/wo/WebObjects/DeviceMgmt.woa/?lang=en". I just get a blank page that says "Unauthorized".
Apple has updated their login system and subsequently broken Sosumi. I haven't dug into their new HTML to fix it yet.
I would like to see an update to get it working again :-)
Apple changed a value in their authentication cookie that caused the scraper to fail. I've talked to tylerhall about it and he said this version is working for him again. I've implemented a working solution in python since I can't do this sort of thing in PHP ;-P.
Bizar .... it should work in php according to http://nat.org/blog/2009/08/playnice-google-apple/ .... and I can confirm !
Sadly, can't get that script working either :( Won't get location from iphone - seems a lot of other people are having similar issues.
Just modify it to strip the quotation marks from the version value in the authentication cookie, works great!





Unfortunately I don't have two iPhones on my account to test with, but it should work by doing something like this...