Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

Twitter - sending webcam image as profile picture

Discussion and questions about Cumulus weather station software version 1. This section is the main place to get help with Cumulus 1 software developed by Steve Loft that ceased development in November 2014.
Post Reply
stevew
Posts: 60
Joined: Sun 01 Mar 2009 3:23 pm
Weather Station: WS2350 (via serial)
Operating System: win7/Linux
Location: Redwood Lake, Reading
Contact:

Twitter - sending webcam image as profile picture

Post by stevew »

In a moment of terminal boredom I thought 'how can I get Cumulus to twitter my weather station data?' - the answer to this proved amazingly easy thanks to Steve's great software and creating a slightly custom feed was also a breeze.

I then considered how to put a web cam image up there as well. On my page at Weather Underground I have a web cam feed http://www.wunderground.com/weatherstat ... =IBERKSRE4 so how could I do something like this with Twitter?

First thought, use TwitPic and upload an image and then add a link to the Cumulus twitter feed, problem - twitter is a micro blog and not really enough space to tweet the weather and a link to the current web cam picture.

Second thought, use the Twitter profile picture, update that from the web cam image every so many minutes, then whenever the weather is tweeted it will have a reasonably upto date picture of the weather to go with it. How hard could it be?

Answer, pretty simple.

Assumption : you will, as I am, already have to have something that grabs your web cam image and can update a single image file on your Weather Station PC. I use YawCam for this, its free, simple and first class. It feeds, via FTP, a web cam image to WeatherUnderground (and will do so to my web site if I ever get time to work on it), allows me to overlay text on the image. Now it also allows me to save the image file on the PC to then send to Twitter

Step 1. The Twitter API looks simple enough, a line of code using CURL (download and install it on your PC) is enough to grab the image file and update your Twitter profile picture

Code: Select all

curl -u twitteruser:password -H "Expect:" -F image=@"imagename.jpg;type=image/jpg" http://twitter.com/account/update_profile_image.xml
(The code above is a single line)

Set twitteruser and password accordingly
Set imagename accordingly

Put this into a batch file, I called mine twitprofile.bat

I put the CURL program and my twitprofile.bat into the Cumulus program folder and had YawCam write the web cam image there too, just to keep things simple and avoid file location paths, if you don't then make sure you specify full paths to things.

Step 2. Set up a Scheduled Task in Windows to run twitprofile.bat every n minutes, base it on how frequently you want the profile image to be updated from yoru web cam, I set mine to 20 minutes, the same period as my weather Twitter feed from Cumlus

Step 3. Have a beer, this step is vital and should always be observed even if steps 1 and 2 lead to failure (if they do keep trying until it works or you are too drunk to care)

now my weather station tweets the weather with a profile picture from my web cam, all updating 3 times an hour (when I have the PC on of course)

http://twitter.com/60Redwood

Not much to see at night of course, next step is to make it use a default image for times when its dark (and YawCam isnt sending an update), this may be something YawCam can do or maybe its another simple bit of CURLing :D

Steve
Last edited by stevew on Tue 10 Nov 2009 8:35 am, edited 3 times in total.
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Twitter - sending webcam image as profile picture

Post by steve »

Excellent - well done! :)
Steve
stevew
Posts: 60
Joined: Sun 01 Mar 2009 3:23 pm
Weather Station: WS2350 (via serial)
Operating System: win7/Linux
Location: Redwood Lake, Reading
Contact:

Re: Twitter - sending webcam image as profile picture

Post by stevew »

The downside, such as it is, with this, is that your profile pic is a single image and therefor it is only valid on the current tweet, the timeline will have the current image too :( hardly a show stopper but it means I still need to use TwitPic for the history
Post Reply