3
votes

I installed the Mirror API sample scripts (PHP) on my (non-ssl) webserver and made some changes to it so it inserts some interesting solar panel data on my Google Glass timeline. Works fine. The adapted sample script now inserts a card on the timeline when I access this PHP web page using a web browser.

My next step would be to insert cards at a regular time interval or by some kind of trigger (e.g. voice command) but certainly not by accessing this web page using a web browsr. I am clearly missing out on something because I still don't see how to go about this... Any help will be greatly appreciated.

1

1 Answers

1
votes

I'm not a php guy, but the idea is same in general.

  1. When user comes to your site, your responsibility is to grant access, via OAUTH2 (as far as I can see you successfully passed that step)

  2. When oauth dance finished, your responsibility is to save access_token and verify_token + userId + etc. to the database. (it should also be done, in a google sample)

  3. To get periodical updates will require you to write some peace of code, for instance:

    1. Windows Service(deploy it somewhere, or run on localhost(not recommended, btw)) + Time Scheduler
    2. bash scripts
    3. web rest services
    4. something else and get it up an running in schedule using for instance

cron jobs (raw idea: http://www.mkyong.com/google-app-engine/cron-job-on-google-app-engine-for-java/ )

where you have to use Mirror Api libraries, provided for language you accepts, or do cook a raw HTTP requiests, as mentioned in https://developers.google.com/glass/v1/reference/timeline