Author Topic: Find my iPhone  (Read 13608 times)

0 Members and 1 Guest are viewing this topic.

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Find my iPhone
« Reply #15 on: August 04, 2014, 06:05:24 PM »
 ::bow ::bow

I found using
strUrl = 'https://www.google.com/maps/place/'+str(locData['latitude']) +','+ str(locData['longitude'])

will put a marker and show coordinates on map ...

thank you again nime5ter for all the help ... when all is ready and working neatly will post the whole thing in the XML exchange forum for other users to benefit from it ...
When Voice command gets tough, use hand gestures

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Find my iPhone
« Reply #16 on: August 13, 2014, 08:33:12 AM »
Now I got all set and running thanks to all your feedback ...

I can say: Alfred where is my son? And like magic VC will pop up google map with location of my son so I can know he reached his destination safely without me bugging him, or Alfred I can't find my phone and VC magic will make my phone ring ... The advantage of paging is that even if the phone on silent it will ring

The new issue that pops up is that icloud sometimes take a while to respond ... And I remember reading a post from James about running a macro in a second thread or new thread ... Can this be applied to these macros? So that VC keep running while it locate the iDevice position?

As well I am working on reversing the geodata to address if anyone with experience can help will be great, then VC would be able to respond with "you forgot your phone at work" instead of paging it directly
When Voice command gets tough, use hand gestures

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Find my iPhone
« Reply #17 on: August 13, 2014, 09:43:25 AM »
Probably the easiest would be to use something like Mapquest's reverse geocoding. You can sign up for free to get an API key for personal use, then you can do get requests (scrape) to retrieve the address. For city addresses, it seems pretty precise.

http://developer.mapquest.com/web/products/open

You can use your latitude and longitude payloads within the URL that you'll be scraping (where I have the [LAT] & [LONG] placeholders below).

Here is a simple example:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.0.6-->
<command id="278" name="Where is John?" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Get your free Mapquest API key from: http://developer.mapquest.com/web/products/open&#xD;&#xA;&#xD;&#xA;In the Scrape action: replace [LAT] &amp; [LONG] with your locData payloads">
  <action>
    <cmdType>Scrape</cmdType>
    <params>
      <param>http://mapquestapi.com/geocoding/v1/reverse?key=YOUR_KEY_HERE&amp;callback=renderReverse&amp;location=[LAT],[LONG]</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegEx</cmdType>
    <params>
      <param>"street":"(.*?)"</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>John is at {Match.1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Where is John </phrase>
</command>
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Find my iPhone
« Reply #18 on: August 13, 2014, 07:04:04 PM »
Probably the easiest would be to use something like Mapquest's reverse geocoding. You can sign up for free to get an API key for personal use,

thank you  ::bow ::bow ... I was looking into google and it sounded complicated the API key thing ... map quest is done and tested, works like a charm ... now no excuses not to finish the Macro.

One question remains ...

The new issue that pops up is that icloud sometimes take a while to respond ... And I remember reading a post from James about running a macro in a second thread or new thread ... Can this be applied to these macros? So that VC keep running while it locate the iDevice position?
When Voice command gets tough, use hand gestures

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Find my iPhone
« Reply #19 on: August 14, 2014, 08:08:10 AM »
If you want a VC command to run in its own thread, add the characters ++ at the beginning of the command name.

e.g. http://voxcommando.com/forum/index.php?topic=1647.msg14344#msg14344

If you want to add threading to your python script, see the gmail notifier python code.
« Last Edit: August 14, 2014, 08:16:54 AM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Find my iPhone
« Reply #20 on: August 14, 2014, 04:34:08 PM »

I found the same thread after some more digging in the forums ...  :clap :clap to me

Your feedback still essential as I was not sure that the ++ is about threading

 ::bow ::bow
When Voice command gets tough, use hand gestures

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Find my iPhone
« Reply #21 on: August 14, 2014, 06:44:02 PM »
Please note that although running a command in its own thread with ++ does work, and specifically VC.Pause will not freeze VC, all other individual actions running within the macro will have to run within the main GUI thread so if you have an action that takes a long time to complete this will freeze VC.

So I recommend using a thread in python if that is possible, for any processing that takes a while to complete.

Hiryu

  • Contributor
  • ***
  • Posts: 53
  • Karma: 2
    • View Profile
Re: Find my iPhone
« Reply #22 on: December 23, 2014, 05:13:11 AM »
Hey guys,

Is the modified code still working (for iPhone devices)?

Just checking.  Thanks.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Find my iPhone
« Reply #23 on: December 23, 2014, 09:50:54 AM »
Which modified code are you referring to? (Maybe just link to the post of interest.)
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Find my iPhone
« Reply #24 on: December 23, 2014, 11:04:19 AM »
Hey guys,

Is the modified code still working (for iPhone devices)?

Just checking.  Thanks.

The last we heard from you, your python plugin was not working at all.

Hiryu

  • Contributor
  • ***
  • Posts: 53
  • Karma: 2
    • View Profile
Re: Find my iPhone
« Reply #25 on: December 23, 2014, 02:28:01 PM »
Sorry, Nime5ter -- I meant the slightly modified iphonepager.py from Hadood.

Jitterjames -- I figured it out!  For some reason, the plugin files in the PY folder were deleted in my backup configuration.  The only thing left was the options.xml.  I have no idea how that happened, since I never go in to tinker with the files in there, but it did.  I knew it had to be user error!  So yeah, that was the problem. 

Anyway, got python working again (at least I know it works with weatherday.xml), but on this one I got "[plugin] System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace --- " in the log.


Hi Kalle ...
late reply due to time differences

there is not much require explanation ...
just place the Python script in PY folder in voxcommando (I am attaching the modified one) then you can call

PY.ExecString iPager("icloud user name usualy email","icloud password", deviceID)
PY.ExecString iLock("icloud user name usualy email","icloud password", deviceID, PassCode)

Device ID is an integer starting with 0, the sequence is the same  ... if you are not sure which is which start iPager with 0 and increment and see which device rings ...
PassCode in the iLock has no effect ifyou already have a passcode enabled ... otherwise PassCode will be the new setting ...

as for iLocate & iWipe ... I have not enabled these functions yet ... iWipe is pretty easy to set, the only problem I do not have a device that I can afford wiping ... iLocate will require some research for mapping services to display the coordinates

hope that helps

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Find my iPhone
« Reply #26 on: December 23, 2014, 03:25:32 PM »
Can you explain more about how you tried to implement and execute Haddood's script?

Did you follow his instructions for calling either of the functions in his script from a VC command (i.e. either the iPager() or the iLock() function)?

Are you trying to run the script in the Python editor somehow, or did you create some kind of VC command that calls one of the functions as per his instructions (if the latter, please post your command)?

Are you sure you're entering the right username and password for your Apple account?
« Last Edit: January 01, 2015, 09:15:45 PM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Find my iPhone
« Reply #27 on: January 01, 2015, 09:25:00 PM »
If you don't tell us what you actually did it is quite difficult to know what might have gone wrong.

Soda97

  • Contributor
  • ***
  • Posts: 69
  • Karma: 1
    • View Profile
Re: Find my iPhone
« Reply #28 on: January 10, 2015, 02:29:46 AM »
I followed Haddood's instruction too and got same result as Hiryu...

did apple blocked or something?

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Find my iPhone
« Reply #29 on: January 10, 2015, 08:43:20 AM »
Maybe try the original script that I posted and let us know if that works for you, with one device.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)