webOS Nation Forums >  Homebrew >  TouchPad Patches > GoogleCL for webos?
GoogleCL for webos?
  Reply
 
Thread Tools Display Modes
Old 01/20/2012, 09:33 AM   #1 (permalink)
Member
 
kevets's Avatar
 
Posts: 570
After getting my cables and USB hub working with my touchpad I started looking at what to do. Looked into command line uploaders and came across GoogleCL (googlecl - Command line tools for the Google Data APIs - Google Project Hosting). It's been a while since I've built anything from source, but it is available as a .deb package as well as the source.

For a while now I've been thinking a good project for an app would be a multiupload kind of utility, that can push things to services like picasa / facebook / flickr from local storage & box.net storage for webos. A baby step for me would be to at least have a script I can run to dump photos from my SD card to my TP and then up them to Picasa. Looks like GoogleCL is set up to do that, but I'm not sure if it can be built/compiled/whatever.

Anyone want to check this out?
__________________
White Z10, Touchpad 16GB [Retired: Pre 3, Pre 2, Pixi Plus, Pre Plus]
Back on a BlackBerry after 2 1/2 years with WebOS.

One-step Picasa batch image upload: http://forums.webosnation.com/hp-tou...ecl-webos.html

Last edited by kevets; 01/31/2012 at 01:29 PM.
kevets is offline   Reply With Quote
Old 01/20/2012, 10:12 AM   #2 (permalink)
Homebrew Developer
 
Posts: 222
Cool program

As it is written in python you only need the interpreter: [link]http://thp.io/2011/webos/[/link]

If you want to embed it in your own program (which is possible and relatively easy) I could help you out with the details. A synergy plugin for Picasa would be awesome
filmor_ is offline   Reply With Quote
Old 01/31/2012, 01:28 PM   #3 (permalink)
Member
 
kevets's Avatar
 
Posts: 570
Just got this working today

It did require a bit more work than I had anticipated, but I was able to do everything without breaking my install and without having to metadoctor. I did have to give more space for the Optware bootstrap because the 128MB loopback volume never seemed to cut it for the Python and GoogleCL installs. I opted for about 2GB of space but 1GB would have done it I bet.

1. Followed the Alternative repartition by hand steps posted by WebOS Internals here: (stop after Step 5 - mkfs.ext3 /dev/mapper/store-ext3fs) UbuntuChroot - WebOS Internals
2. Uninstall Optware bootstrap and other associated preware apps (if installed).
3. Reboot.
4. Install Optware Bootstrap and Optware Advanced Linux Command Line Installer.
5. Check space by running "df|more" in wTerm and confirm the right amount of space is available for /opt.
6. Fire up wTerm and run the following:
6a. ipkg-opt update
6b. ipkg-opt install python25
6c. ipkg-opt install py25-simplejson
7. Download latest GoogleCL (Downloads - googlecl - Command line tools for the Google Data APIs - Google Project Hosting) and gdata-python-client (Downloads - gdata-python-client - Google Data APIs Python Client Library - Google Project Hosting) using wget.
8. Tar -zxf both files.
9. Run python25 setup.py install on both of the resulting directories for the GoogleCL and gdata client files.
10. Run "/opt/local/bin/google picasa create".
10a. Hit enter on the prompts (all we want is the auth token URL).
10b. Once the authentication token URL is displayed, type it into an open browser window and sign in/authorize your Touchpad token to give it access to your Google account.

At this point, you have authenticated your touchpad via the Google API and can run commands against it. Examples available here: Manual - googlecl - How to use GoogleCL. - Command line tools for the Google Data APIs - Google Project Hosting

I'll follow up this post with an example script I've written to upload photos modified in the last 7 days and prompt to delete. This, in effect, is trying to reproduce the Android 'Instant Upload' functionality. In essence, I now have a way of copying photos off my digital camera SD card to local Touchpad storage, uploading them directly to Picasa, and deleting them off my Touchpad in one step.
__________________
White Z10, Touchpad 16GB [Retired: Pre 3, Pre 2, Pixi Plus, Pre Plus]
Back on a BlackBerry after 2 1/2 years with WebOS.

One-step Picasa batch image upload: http://forums.webosnation.com/hp-tou...ecl-webos.html
kevets is offline   Reply With Quote
Old 02/01/2012, 09:40 AM   #4 (permalink)
Member
 
kevets's Avatar
 
Posts: 570
Here is an example script I used to upload recent photos to Picasa. I use a Panasonic camera which saves to a 102_PANA folder, so basically I've got a matching folder on the /media/internal/DCIM side on my TP that I copy to.

Mount/Copy/Unmount/Upload script (I've determined that my USB hub card reader's SD slot always shows up as /dev/sdc1 but yours may be different):

mount /dev/sdc1 /mnt/usb
echo COPY START
find /mnt/usb/DCIM/102_PANA -mtime -7 -type f -exec cp {} /media/internal/DCIM/102_PANA/ \;
echo COPY FINISHED
umount /mnt/usb
read -p "UPLOAD FILES? y/n: "
[ "$REPLY" == "y" ] || exit
find /media/internal/DCIM/102_PANA -mtime -7 -type f -exec /opt/local/bin/google picasa post --title "Instant Upload" {} \;
echo UPLOAD FINISHED
read -p "DELETE LOCAL COPIES? y/n: "
[ "$REPLY" == "y" ] || exit
echo DELETING FILES
find /media/internal/DCIM/102_PANA -mtime -7 -type f -exec rm {} \;
echo Done!


This assumes there is an existing Picasa album called Instant Upload, and that your TP has been authenticated with your Google account (see previous post), but works great for a one-step upload from SD card to cloud storage.
__________________
White Z10, Touchpad 16GB [Retired: Pre 3, Pre 2, Pixi Plus, Pre Plus]
Back on a BlackBerry after 2 1/2 years with WebOS.

One-step Picasa batch image upload: http://forums.webosnation.com/hp-tou...ecl-webos.html
kevets is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0