Los Angeles, CA, United States
Offline
Full Member
Karma: 2
Posts: 206
|
 |
« on: December 29, 2010, 12:58:04 pm » |
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1231812230. I need to create two feeds. One will display the current date and time and the other will display how many new emails I have in Gmail (my email provider). I will then combine the two feeds to create one feed that I will retrieve using the code provided earlier. Does anybody know any services that will allow me to do this? Thanks, Carnyworld... PS: Sorry if this is the wrong section, its the best section that I could find.
|
|
|
|
|
Logged
|
C program run. C program crash. C programmer quit.
|
|
|
|
Los Angeles, CA, United States
Offline
Full Member
Karma: 2
Posts: 206
|
 |
« Reply #1 on: December 29, 2010, 12:59:28 pm » |
What I am asking is how I can see how I can see how many emails I have, the current time, and what the current temperature is... All via rss feed.
|
|
|
|
« Last Edit: December 29, 2010, 12:59:46 pm by Carnyworld »
|
Logged
|
C program run. C program crash. C programmer quit.
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 90
Posts: 9401
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #2 on: December 29, 2010, 01:13:00 pm » |
you crossposted (?) and I answered in the other thread - http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1293601117If you search the forum with weather and web you should ffind relevant links for temp.
|
|
|
|
« Last Edit: December 29, 2010, 01:13:32 pm by robtillaart »
|
Logged
|
|
|
|
|
Los Angeles, CA, United States
Offline
Full Member
Karma: 2
Posts: 206
|
 |
« Reply #3 on: December 29, 2010, 01:19:08 pm » |
Yeah, ignore the other post. How would I display the Current Time though?
|
|
|
|
|
Logged
|
C program run. C program crash. C programmer quit.
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 90
Posts: 9401
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #4 on: December 29, 2010, 03:47:29 pm » |
Connect a DS1307 RTC (RealTime Clock) to your Arduino. Lady ada sells a nice shield with RTC and has a tutorial on their site how to use the RTC library. See - http://www.ladyada.net/make/logshield/Once you set the time of the DS1307 it will be quite accurate for years. You can set the RTC by means of the NTP protocol, see - http://www.arduino.cc/playground/Main/DS1307OfTheLogshieldByMeansOfNTP
|
|
|
|
|
Logged
|
|
|
|
|
Los Angeles, CA, United States
Offline
Full Member
Karma: 2
Posts: 206
|
 |
« Reply #5 on: December 29, 2010, 06:54:36 pm » |
I now have a feed at http://www.google.com/reader/atom/user%2F15916171905404598697%2Flabel%2FArduinoI need help with this part of code: // Find specific tags and print data if (matchTag("<temp_f>")) { Serial.print("Temp: "); Serial.print(dataStr); } if (matchTag("<relative_humidity>")) { Serial.print(", Humidity: "); Serial.print(dataStr); } if (matchTag("<pressure_in>")) { Serial.print(", Pressure: "); Serial.print(dataStr); Serial.println(""); } How can I extract the text of each emails subject line as they all have the same tags which in this case is <title type="html"></title>. Currently also I have the feed displaying more than just temperature. How can I extract only the temperature and nothing else?
|
|
|
|
|
Logged
|
C program run. C program crash. C programmer quit.
|
|
|
|
Los Angeles, CA, United States
Offline
Full Member
Karma: 2
Posts: 206
|
 |
« Reply #6 on: December 29, 2010, 07:07:37 pm » |
Here is the Feed: This XML file does not appear to have any style information associated with it. The document tree is shown below. [ch8722] <feed idx:index="no" gr:dir="ltr"> <!-- Content-type: Preventing XSRF in IE.
--> <generator uri="http://www.google.com/reader">Google Reader</generator> [ch8722] <id> tag:google.com,2005:reader/user/15916171905404598697/label/Arduino </id> <title>"Arduino" via Christopher in Google Reader</title> <link rel="self" href="http://www.google.com/reader/atom/user%2F15916171905404598697%2Flabel%2FArduino"/> [ch8722] <author> <name>Christopher</name> </author> <updated>2010-12-29T23:02:09Z</updated> [ch8722] <entry gr:crawl-timestamp-msec="1293663729775"> <id gr:original-id="tag:gmail.google.com,2004:1356504650833327926">tag:google.com,2005:reader/item/ec593d1f5b807205</id> <category term="user/15916171905404598697/label/Arduino" scheme="http://www.google.com/reader/" label="Arduino"/> <category term="user/15916171905404598697/bundle/Arduino" scheme="http://www.google.com/reader/" label="Arduino"/> <category term="user/15916171905404598697/bundle" scheme="http://www.google.com/reader/"/> <category term="user/15916171905404598697/state/com.google/reading-list" scheme="http://www.google.com/reader/" label="reading-list"/> <category term="user/15916171905404598697/state/com.google/fresh" scheme="http://www.google.com/reader/" label="fresh"/> <title type="html">shadow</title> <published>2010-12-29T23:00:45Z</published> <updated>2010-12-29T23:00:45Z</updated> <link rel="alternate" href="http://mail.google.com/mail?account_id=christopherjelledge@gmail.com&message_id=12d345caf915f736&view=conv&extsrc=atom" type="text/html"/> [ch8722] <summary xml:base="http://mail.google.com/mail" type="html"> This email was sent via Anonymous email service for free. YOU CAN REMOVE THIS TEXT MESSAGE BY ... </summary> [ch8722] <author> <name>Chkhdkj</name> </author> [ch8722] <source gr:stream-id="feed/http://freemyfeed.com/feed/aHR0cHM6Ly9tYWlsLmdvb2dsZS5jb20vbWFpbC9mZWVkL2F0b206OkNocmlzdG9waGVyamVsbGVkZ2U6OkY0VVIrWGI1TzdCemU4bmpNNEpjT3pvNk1RPT0="> [ch8722] <id> tag:google.com,2005:reader/feed/http://freemyfeed.com/feed/aHR0cHM6Ly9tYWlsLmdvb2dsZS5jb20vbWFpbC9mZWVkL2F0b206OkNocmlzdG9waGVyamVsbGVkZ2U6OkY0VVIrWGI1TzdCemU4bmpNNEpjT3pvNk1RPT0= </id> <title type="html">Gmail - Inbox for christopherjelledge@gmail.com</title> <link rel="alternate" href="http://mail.google.com/mail" type="text/html"/> </source> </entry> [ch8722] <entry gr:crawl-timestamp-msec="1293663729775"> <id gr:original-id="tag:gmail.google.com,2004:1356502460486981398">tag:google.com,2005:reader/item/2a2148e7bd9ba34d</id> <category term="user/15916171905404598697/label/Arduino" scheme="http://www.google.com/reader/" label="Arduino"/> <category term="user/15916171905404598697/bundle/Arduino" scheme="http://www.google.com/reader/" label="Arduino"/> <category term="user/15916171905404598697/bundle" scheme="http://www.google.com/reader/"/> <category term="user/15916171905404598697/state/com.google/reading-list" scheme="http://www.google.com/reader/" label="reading-list"/> <category term="user/15916171905404598697/state/com.google/fresh" scheme="http://www.google.com/reader/" label="fresh"/> <title type="html">Test</title> <published>2010-12-29T22:25:56Z</published> <updated>2010-12-29T22:25:56Z</updated> <link rel="alternate" href="http://mail.google.com/mail?account_id=christopherjelledge@gmail.com&message_id=12d343ccfe451716&view=conv&extsrc=atom" type="text/html"/> <summary xml:base="http://mail.google.com/mail" type="html">Test</summary> [ch8722] <author> <name>me</name> </author> [ch8722] <source gr:stream-id="feed/http://freemyfeed.com/feed/aHR0cHM6Ly9tYWlsLmdvb2dsZS5jb20vbWFpbC9mZWVkL2F0b206OkNocmlzdG9waGVyamVsbGVkZ2U6OkY0VVIrWGI1TzdCemU4bmpNNEpjT3pvNk1RPT0="> [ch8722] <id> tag:google.com,2005:reader/feed/http://freemyfeed.com/feed/aHR0cHM6Ly9tYWlsLmdvb2dsZS5jb20vbWFpbC9mZWVkL2F0b206OkNocmlzdG9waGVyamVsbGVkZ2U6OkY0VVIrWGI1TzdCemU4bmpNNEpjT3pvNk1RPT0= </id> <title type="html">Gmail - Inbox for christopherjelledge@gmail.com</title> <link rel="alternate" href="http://mail.google.com/mail" type="text/html"/> </source> </entry> [ch8722] <entry gr:is-read-state-locked="true" gr:crawl-timestamp-msec="1293658655144"> <id gr:original-id="CurrentTxt-Wed, 29 Dec 2010 21:00:00 GMT">tag:google.com,2005:reader/item/c8a200bc564d48a3</id> <category term="user/15916171905404598697/state/com.google/read" scheme="http://www.google.com/reader/" label="read"/> <category term="user/15916171905404598697/label/Arduino" scheme="http://www.google.com/reader/" label="Arduino"/> <category term="user/15916171905404598697/bundle/Arduino" scheme="http://www.google.com/reader/" label="Arduino"/> <category term="user/15916171905404598697/bundle" scheme="http://www.google.com/reader/"/> <category term="user/15916171905404598697/state/com.google/reading-list" scheme="http://www.google.com/reader/" label="reading-list"/> [ch8722] <title type="html"> Current Conditions from Notre Dame HS, Sherman Oaks, CA </title> <published>2010-12-29T21:00:00Z</published> <updated>2010-12-29T21:00:00Z</updated> <link rel="alternate" href="http://web.live.weatherbug.com/Common/home.aspx?zcode=z4641&zip=91423&units=0&rnd=Obs122920101600" type="text/html"/> [ch8722] <summary xml:base="http://web.live.weatherbug.com/Common/Home.aspx?zcode=z4641&zip=91423" type="html"> <b>Temperature:</b> 52.9 °F <br> <br> <b>Humidity:</b> 99 % <b>Wind Speed:</b> 4 mph ESE <b>Pressure:</b> 29.63 " <br> <br> <b>Dew Point:</b> 53 °F <b>Gusts:</b> 15 mph E <b>Rain Today:</b> 0.42 " <br> </summary> [ch8722] <author gr:unknown-author="true"> <name>(author unknown)</name> </author> [ch8722] <source gr:stream-id="feed/http://feeds.weatherbug.com/rss.aspx?zipcode=91423&feed=currtxt&zcode=z4641"> [ch8722] <id> tag:google.com,2005:reader/feed/http://feeds.weatherbug.com/rss.aspx?zipcode=91423&feed=currtxt&zcode=z4641 </id> <title type="html">WeatherBug Current Conditions for 91423</title> <link rel="alternate" href="http://web.live.weatherbug.com/Common/Home.aspx?zcode=z4641&zip=91423" type="text/html"/> </source> </entry> [ch8722] <entry gr:is-read-state-locked="true" gr:crawl-timestamp-msec="1293649440301"> <id gr:original-id="CurrentTxt-Wed, 29 Dec 2010 19:00:00 GMT">tag:google.com,2005:reader/item/595e0762c068ce17</id> <category term="user/15916171905404598697/state/com.google/read" scheme="http://www.google.com/reader/" label="read"/> <category term="user/15916171905404598697/label/Arduino" scheme="http://www.google.com/reader/" label="Arduino"/> <category term="user/15916171905404598697/bundle/Arduino" scheme="http://www.google.com/reader/" label="Arduino"/> <category term="user/15916171905404598697/bundle" scheme="http://www.google.com/reader/"/> <category term="user/15916171905404598697/state/com.google/reading-list" scheme="http://www.google.com/reader/" label="reading-list"/> [ch8722] <title type="html"> Current Conditions from Notre Dame HS, Sherman Oaks, CA </title> <published>2010-12-29T19:00:00Z</published> <updated>2010-12-29T19:00:00Z</updated> <link rel="alternate" href="http://web.live.weatherbug.com/Common/home.aspx?zcode=z4641&zip=91423&units=0&rnd=Obs122920101400" type="text/html"/> [ch8722] <summary xml:base="http://web.live.weatherbug.com/Common/Home.aspx?zcode=z4641&zip=91423" type="html"> <b>Temperature:</b> 51.6 °F <br> <br> <b>Humidity:</b> 99 % <b>Wind Speed:</b> 4 mph ESE <b>Pressure:</b> 29.7 " <br> <br> <b>Dew Point:</b> 51 °F <b>Gusts:</b> 15 mph E <b>Rain Today:</b> 0.42 " <br> </summary> [ch8722] <author gr:unknown-author="true"> <name>(author unknown)</name> </author> [ch8722] <source gr:stream-id="feed/http://feeds.weatherbug.com/rss.aspx?zipcode=91423&feed=currtxt&zcode=z4641"> [ch8722] <id> tag:google.com,2005:reader/feed/http://feeds.weatherbug.com/rss.aspx?zipcode=91423&feed=currtxt&zcode=z4641 </id> <title type="html">WeatherBug Current Conditions for 91423</title> <link rel="alternate" href="http://web.live.weatherbug.com/Common/Home.aspx?zcode=z4641&zip=91423" type="text/html"/> </source> </entry> </feed>
|
|
|
|
|
Logged
|
C program run. C program crash. C programmer quit.
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 90
Posts: 9401
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #7 on: December 30, 2010, 03:17:34 am » |
How can I extract the text of each emails subject line as they all have the same tags which in this case is <title type="html"></title>.
Think you just need to add the following code for your email-titles and as the code parses all XML passing by they will all be detected.. give it a try. if (matchTag("<title type=\"html\">")) // NOTE the \ 's { Serial.print(", Mail: "); Serial.print(dataStr); Serial.println(); // omit "" }
so add all the 'stuff found' in the tag or do a half Tag test if (matchTag("<title ")) // simpler match not as robust but will prob work. { Serial.print(", Mail: "); Serial.print(dataStr); Serial.println(); // omit "" }
As matchTag() is just a wrapper around stringcmp(), you can speed up things a tiny bit by using strcmp directly.
|
|
|
|
« Last Edit: December 30, 2010, 03:24:56 am by robtillaart »
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 90
Posts: 9401
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #8 on: December 30, 2010, 03:30:51 am » |
Currently also I have the feed displaying more than just temperature. How can I extract only the temperature and nothing else? What does it show - note that the forummembers cannot see your display  Please share your whole code as that makes it much easier to help.
|
|
|
|
« Last Edit: December 30, 2010, 03:31:00 am by robtillaart »
|
Logged
|
|
|
|
|
|