maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   N900 + Google Latitude (https://talk.maemo.org/showthread.php?t=38542)

MasterZap 2011-05-13 14:40

Re: N900 + Google Latitude
 
Ok, I worked a little on my script over the weekend... a wee bit.... and then I pulled an all nighter since my wife was away on a tradeshow anyway... so... what emerged is in extras/devel repository as "ZapLoc".

This is a very early version, but.... lemme know if it installs and works for you. Getting things to install through a repository on maemo was rather... tricky.


EDIT 2 - I (think I) I have fixed the google api installer, so try normal instal BEFORE trying this workaround


EDIT: Just installing ZapLoc doesn't work, because I botched the packaging of the google api client. To install it use these NEW instructions:
  1. Install ZapLoc from the program manager (location category) or by doing "apt-get install zaploc" (same thing)
  2. Now we need to get the Google Api Python Client thingamabob installed (this doesn't work in the installation - apologies)
  3. Open X-term
  4. Become root (at least I think you need to be root)
    Code:

    sudo gainroot
  5. Go to some random directory for downloading unzipping
    Code:

    cd /home/user/MyDocs/
  6. Download http://google-api-python-client.goog...t-1.0beta2.zip
    Code:

    wget http://google-api-python-client.googlecode.com/files/google-api-python-client-1.0beta2.zip
  7. Unzip it
    Code:

    unzip api-python-client-1.0beta2.zip
  8. Go to that dir and run
    Code:

    cd api-python-client-1.0beta2.zip
    python setup.py install

  9. Now ZapLoc should (in theory) work.
  10. If you want, you can delete the downloaded file and clear out and remove the directory, 'tis no longer needed.
    Code:

    rm -r api-python-client-1.0beta2
    rm api-python-client-1.0beta2.zip


/Z

ndi 2011-05-13 15:59

Re: N900 + Google Latitude
 
What was it supposed to do? Mine put an icon in the menu, but when clicked it does nothing. Not even closing the menu and crashing, it just highlights the icon and freezes.

Manual launch? How?

gazza_d 2011-05-13 16:03

Re: N900 + Google Latitude
 
any chance of a rough changelog and or some screenshots?

MasterZap 2011-05-13 16:40

Re: N900 + Google Latitude
 
Could be an issue with the google api not being installed... I tried to make it a package... try

apt-get install google-api-python-client

See if you have a directory "apiclient" in /usr/lib/python2.5/site-packages called "apilibrary"

If not, then I screwed up the api installer somehow, and you will have to use the method descibed earlier in this thread. Hmm. I tried to be rid of that dependency but I gave up on writing my own version.... oh well.

EDIT: It indeed was, see a few posts up for instructions on how to get around that manually for now

/Z

MasterZap 2011-05-13 16:47

Re: N900 + Google Latitude
 
(never mind, this wasn't it - clearing out post so misleading info isn't there)

ndi 2011-05-13 20:52

Re: N900 + Google Latitude
 
Quote:

Originally Posted by MasterZap (Post 1005641)
Also make sure you have version 0.9.4-7 or newer, the previous one had the "just freezes when clicking the icon" problem.

I do. Freeze.

Quote:

Originally Posted by MasterZap (Post 1005641)
You can try to manually do

python /opt/zaploc/main.py

Code:

$ python /opt/zaploc/main.py
Traceback (most recent call last):
  File "/opt/zaploc/main.py", line 3, in <module>
    import zaploc
  File "/opt/zaploc/zaploc.py", line 20, in <module>
  File "/opt/zaploc/zdaemon.py", line 16, in <module>
  File "/opt/zaploc/zlatitude.py", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/apiclient/discovery.py", line 29, in <module>
    import uritemplate
ImportError: No module named uritemplate
~ $

Quote:

Originally Posted by MasterZap (Post 1005641)
chmod 777 /opt/zaploc
chmod +x /opt/zaploc/*.py

Don't think that's my problem.

Quote:

Originally Posted by MasterZap (Post 1005641)
See if you have a directory "apiclient" in /usr/lib/python2.5/site-packages called "apilibrary"

That sentence no sense. :)

I have a directory called /usr/lib/python2.5/site-packages/apiclient

There are some .py and some .pyc files in there, and some other underscore files. No more.

Two folders, contrib and ext. Contrib has buzz, latitude and moderator and "ext" has appengine py-s.

There is no sign of an apilibrary. In fact, there is no file called *apilibrary* anywhere in my filesystem.

The package zaploc depends on google-api-python-client and it was subsequently installed (shows up as installed, 1.0.1-1). Botched google-api-python-god-i-hate-this-naming-sistem-client?

Suggestions?

MasterZap 2011-05-14 05:35

Re: N900 + Google Latitude
 
Yes, that sentence made no sense, sorry. Meant "apiclient" only.

Naming convention is googles not mine... I just packaged it.

as for yor problem, try

apt-get install python-oauth python-oauth2

I don't know which package this missing "uritemplate" is supposedly from :( is there a way to know this?

/Z

MasterZap 2011-05-14 05:46

Re: N900 + Google Latitude
 
oooh, it was supposed to be part of the google latitude api stuff. Crap.

I know I should never have tried to package that :(

Ok, do this:

Step 1: download http://google-api-python-client.goog...t-1.0beta2.zip

Step 2: unzip it to some directory

Step 3: go into this directory and type
Code:

python setup.py install
If this worked, (you see it copy a bunch of stuff) you can delete the download and the directory you made if you want.

Hope this... helps?

/Z

MasterZap 2011-05-14 07:18

Re: N900 + Google Latitude
 
ok I THINK I have fixed the packaging of google-api-python-client...

Pleasy try original install now, by simply installing zaploc only. SHOULD work.




In theory.




;)


/Z

kurtyy 2011-05-14 13:02

Re: N900 + Google Latitude
 
@masterzap

thx this app is what i was looking for since a long time.
install works as well app starts also. i setup the background location and my latitude account.

but the app isn't going to determine my current position?
there is also no gps icon shown in the notification/task area.

anny suggestion is welcome


thx a lot

ndi 2011-05-14 14:05

Re: N900 + Google Latitude
 
Yup, it goes like nuts now.

Only one complaint. It froze once, had to kill it and it left the daemon running even after subsequent restarts of app. I had to kill -9.

An option to killall or similar on startup or in options would be nice. Restart daemon or similar that kills all daempns and starts a fresh one.


Other than that, cooool.

MasterZap 2011-05-14 14:06

Re: N900 + Google Latitude
 
ok, two things:

First, the app intentionally sleeps the GPS between sampling to conseve battery.

Secondly, by DEFAULT, the daemon turns off when you shut the program down, unless you explicitly turn that on in the configuration... I set this as the default because some people are paranoid about location being shared "when they don't know it", so YOU gave to turn it on.

/Z

MasterZap 2011-05-14 16:42

Re: N900 + Google Latitude
 
Uh, it does... (or is supposwd to) kill/restart (all) daemon(s) when youbstart the app....

/Z

MasterZap 2011-05-16 05:41

Re: N900 + Google Latitude
 
1 Attachment(s)
Ok, there has been some requests for "latitude only" stuff, and not my whole "app".... find that part attached.

Let me explain the story.

Obviously, me posting my whole app as a "small modification to the script" was, of course, a bit of a joke. I'm a comedian like that, and anyone who knows my dry humor would attest to this ;)


What REALLY happened: I had been playing with my app for QUITE some time, as a personal tool to check in to multiple locations. I hadn't combined it with Latitude, nor did I have have an automatic update daemon yet.


When I was playing with this update script, I realized that (some of) that code also applied to my app... and.... that with some sugar and spice, it could almost become a useable app, that I release!


So I decided to package up the app, and as a bit of a joke, post it here as if "oh by the way, I made a small modification to the script", and hilarity would ensue as I had undersold and overdelivered.

All that was thwarted by my screwed up packaging, and the joke went stale and unfunny. *badoom-not-psssh*... oh well :/ Sorry.


So - if you are interested in anything MORE than just Latitude, I still recommend you try out "ZapLoc" (you are welcome in the ZapLoc thread for that).


However, several people were only really interested in the "smarter updating of latitude" but ONLY, so that code is attached here:


This script is DIFFERENT than before. Gone are the "--once" option. Gone is the idea to start it from "Alarmed". Instead, this code will - after receiving a "good enough" GPS sample - sleep the GPS (turn it off, basically, not consuming any power) for a set number of minutes, and then turn it on again. Basically, the app is doing nothing consuming zero CPU for this time, and then turns back on and gets a GPS sample again after some minutes.

How many minutes of what, you can set yourself in the variables with upper-case names in the beginning of the file, here:

PHP Code:

EPS               0.001  # Points within this many degrees are considered "same" and not sent
UPDATE_AT_MOST    1      # NEVER update more than this (minutes) even when moving
UPDATE_AT_LEAST   60     # NEVER update LESS than this (minutes) even when still (to avoid "stale points" in Latitude)
GPS_INTERVAL      5      # How often to "awaken" the GPS (minutes) 

ALSO, the script still requires the google api, but I have made a package of that, in extras/devel you can be root and do

Code:

apt-get install google-api-python-client
...to get that to happen.

Enjoy.

Or not. :)

/Z

jpala16 2011-05-16 07:13

Re: N900 + Google Latitude
 
I like your work, Zap. The app is quite childish, but it really works, and well. An easy way to check in, to edit the configuration by a friendly UI, and a daemon in the background.

The only thing I miss is the possibility to check friends location in the map for Latitude, but as it wasn't the aim of your work and the app is not only Latitude. So I understand it not to be there.

Thanks for your work! :D

MasterZap 2011-05-16 12:51

Re: N900 + Google Latitude
 
Oh I wanted to add friends too.... but the Latitude API doesn't support that ... annoying, surprising... and strange!!! What is the point of a latitude API that can only post your own location?

You CAN get to your own location history, though.

Hmm.

/Z

kurtyy 2011-05-17 07:55

Re: N900 + Google Latitude
 
Hi,

as i allready wrote, my location wasn't detected. not even the gps started when running the app. after manually installing python-location

PHP Code:

apt-get install python-location 

everything works fine.

regards

LQW77 2011-05-25 22:56

Re: N900 + Google Latitude
 
Is not loading friends and not able to detect my location on the map.
Tried that kurtyy says but Python-location is already the newest version, my X-Term said.

What's wrong?

rlinfati 2011-07-27 19:08

Re: N900 + Google Latitude
 
Hi

I update my latitude client after a lot of time to be compatible with the new google api and oauth \o/

Nokia N900 - Fremantle - QWdidget-Based
http://maemo.org/packages/view/googlelatitude/ v0.7 and up

Nokia N950 - Harmattan - QML-Based
http://mapdata.linfati.cl/googlelatitude-harmattan.deb

colm.smyth 2011-07-28 10:39

Re: N900 + Google Latitude
 
can you post some pics ?

Quote:

Originally Posted by rlinfati (Post 1059469)
Hi

I update my latitude client after a lot of time to be compatible with the new google api and oauth \o/

Nokia N900 - Fremantle - QWdidget-Based
http://mapdata.linfati.cl/fremantle-..._1-0_armel.deb

Nokia N950 - Harmattan - QML-Based
http://mapdata.linfati.cl/harmattan-..._1-0_armel.deb

Know bugs: the QML-based gui do not work in vertical mode :(


petur 2011-07-28 10:47

Re: N900 + Google Latitude
 
I bet everybody moved on to use ZapLoc....

cpm 2011-07-30 19:33

Re: N900 + Google Latitude
 
Quote:

Originally Posted by rlinfati (Post 1059469)
I update my latitude client after a lot of time to be compatible with the new google api and oauth \o/

Thanks. I tried it, but I don't see any updates appearing. I can see on my Google profile I've allowed "LatitudeUpdater" access. I can see the GPS icon appear, but no location updates appear on Latitude's website. I've rebooted. I'm not sure what's gone wrong... The previous version worked well before Google changed things server-side.

Keferen 2011-07-31 01:50

Re: N900 + Google Latitude
 
while testing this app it didnt actually work, didnt make one update which i was watching from the web at the same time, for hours...

however after doing a bit of reading on the google latitude api, if this maemo app worked i could see some features to add.

the api supports history update which is a feature of the webpage to track your own movements. interesting. obviously this maemo app if it cant make updates it should be able to cache/queue its updates until it can make an update and thus history is kept complete.

and if google eventually allow the latitude api to have friends locations be known (although this can be stripped from the webpage lol), this should be integrated into the contact list for that friends current location and last time they updated.

i guess my overall end picture here is to eventually get a proper google maps integration with latitute with contact list so one can just click on that contact, and maps will pop up with a turn by turn to their location. great dream :)

cpm 2011-08-15 21:24

Re: N900 + Google Latitude
 
I've spotted this in my Latitude settings:

Account settings -> Authorizing applications & sites -> You have granted the following services access to your Google Account: LatitudeUpdater -> More info -> You haven't given <<NUMBER>>.apps.googleusercontent.com any permission to access your Latitude location information.

I've run /opt/linfati.com/bin/LatitudeUpdaterDaemon in a shell and noticed the following problems:

* GoogleLatitude::onRequestReady "{"error":{"errors":[{"domain":"global","reason":"insufficientPermissio ns","message":"The user is not opted in to Google Latitude."}],"code":403,"message":"The user is not opted in to Google Latitude."}}"


* GoogleLatitude::sendCurrentLocation
json_location "{"data": {"kind":"latitude#location","latitude":<<LATITUDE> >,"longitude":<<LONGITUDE>>,"accuracy":<<ACCURACY> >}}"
("Authorization", "Content-Type")
"OAuth oauth_signature_method="HMAC-SHA1", oauth_consumer_key="<<NUMBER>>.apps.googleusercont ent.com", oauth_version="1.0", oauth_timestamp="<<NUMBER>>", oauth_nonce="<<NUMBER>>", oauth_token="<<TOKEN>>", oauth_signature="<<SIGNATURE>>""
"application/json"
* GoogleLatitude::onRequestReady ""
* GoogleLatitude::onAuthorizedRequestDone
* GoogleLatitude::onRequestReady "{"error":{"errors":[{"domain":"global","reason":"backendError","messag e":"Backend Error"}],"code":503,"message":"Backend Error"}}"

Hope this helps...

rlinfati 2011-08-17 11:21

Re: N900 + Google Latitude
 
backend error ? uh...

please, delete ~/.config/linfati.com/latitudeupdater.conf and try again to auth

subchaser 2011-08-17 20:51

Re: N900 + Google Latitude
 
Rodrigo, there are changes in API was announced some time ago, according to updated Developer's Guide (v1): Using REST :

Quote:

Your application must use OAuth 2.0 to authorize requests. No other authorization protocols are supported.

cpm 2011-08-17 21:14

Re: N900 + Google Latitude
 
Quote:

Originally Posted by rlinfati (Post 1071715)
backend error ? uh...

please, delete ~/.config/linfati.com/latitudeupdater.conf and try again to auth

Thanks for the suggestion. I have:

Deleted ~/.config/linfati.com and ~/.config/linfati (old version) config directories.
Revoked access to the app in Google account settings so they're recreated from scratch.
Reauthenticated via the "Auth" button in the application, allowing access and getting to the "OAuth finished" screen.
Closed app and started /opt/linfati.com/bin/LatitudeUpdaterDaemon from console to get debug output

Same errors:

"You haven't given <number>.apps.googleusercontent.com any permission to access your Latitude location information." (from Google account settings page)

* GoogleLatitude::onRequestReady "{"error":{"errors":[{"domain":"global","reason":"insufficientPermissio ns","message":"The user is not opted in to Google Latitude."}],"code":403,"message":"The user is not opted in to Google Latitude."}}"
...
* GoogleLatitude::onRequestReady "{"error":{"errors":[{"domain":"global","reason":"backendError","messag e":"Backend Error"}],"code":503,"message":"Backend Error"}}"

Thanks.

cpm 2011-08-17 21:40

Re: N900 + Google Latitude
 
I've just compared the oAuth process between LatitudeWidget and ZapLoc (which works).

With ZapLoc, I get two pages:

page 1:
The site <number>.apps.googleusercontent.com is requesting access to your Google Latitude account. If you are granting <number>.apps.googleusercontent.com access for the first time, you'll need to grant access to Latitude below and then to your Google Account on a following page.

Do you want to grant <number>.apps.googleusercontent.com access to:

* View and update your best-available location
* View and update your current location
page 2:
The Zap's Location Updater application on your computer is requesting access to your Google Account for the product(s) listed below.

Google Latitude
With LatitudeWidget, I just get the 2nd page:
The LatitudeUpdater application on your computer is requesting access to your Google Account for the product(s) listed below.

Google Latitude
When I look at ZapLoc permissions:
This site currently has access to:

View and update your best-available location
View and update your current location
With LatitudeWidget:
You haven't given <number>.apps.googleusercontent.com any permission to access your Latitude location information.
Hope this helps. Thanks.

rlinfati 2011-08-18 00:55

Re: N900 + Google Latitude
 
wired..., with my account:

You have granted xxx.apps.googleusercontent.com access to your Google Latitude account.
This site currently has access to:
View your city-level location
Update your best-available location
View and update your current location

:/

cpm 2011-08-20 14:47

Re: N900 + Google Latitude
 
I've tried using a different Google account (to see if it was account-specific), but it didn't fix the problem.

I've had a look at the Latitude OAuth doc, specifically the bit about scope:
http://code.google.com/apis/latitude...rest.html#auth

I've checked out your code from git and the only bit I could find that looked scope-related is this line (line 20) in googlelatitude.cpp:
GoogleOauthAdditional.insert("scope", "https://www.googleapis.com/auth/latitude");

Should this be asking for "latitude.current.best" or similar, rather than just "latitude"?

I don't have a compilation environment set up to try different settings out.

Could you have set permissions manually during development and not added code to do it in the released version? Could you revoke access in your Google account settings and then try authorising again using the released version of your app to see if it stops working?

Hope this helps. Thanks for your assistance.

petur 2012-02-03 10:38

Re: N900 + Google Latitude
 
Just wondering, at what point in time was the map removed?

I could really do with an app to view friends location (meeting them at fosdem), but I can only find blogs and screenshots about LatitudeUpdater showing a map, current version doesn't.... :(

midcex 2012-02-04 13:02

Re: N900 + Google Latitude
 
why every open app on the desktop can not open google latitude disappear ...:(

midcex 2012-02-05 14:29

Re: N900 + Google Latitude
 
http://www.google.com/mobile/latitude/


:)

petur 2012-02-06 08:37

Re: N900 + Google Latitude
 
Quote:

Originally Posted by midcex (Post 1160856)

and your point is??????

mybluevan 2012-04-03 22:27

Re: N900 + Google Latitude
 
I did some digging in the code and the Google APIs site. Turns out the LatitudeUpdater app is using OAuth v1.0 still. Google is forcing OAuth v2.0 for all Latitude API calls. So, it's dead for now until the program is updated to handle OAuth2. :(

int_ua 2012-07-02 23:40

Re: N900 + Google Latitude
 
The desktop (web) version is working for me, didn't notice any problems.


All times are GMT. The time now is 04:39.

vBulletin® Version 3.8.8