Mon, 06 Dec 2010 04:38:47 +0000
Rename xmppstream to xmlstream, and make some changes to make it compatible with Prosody
2
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
1 | require "feeds" |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
2 | |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
3 | -- Example feed as a string (only a single entry in this example) |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
4 | local feed = feeds.feed_from_string [[<feed xmlns="http://www.w3.org/2005/Atom"> |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
5 | <title>Planet Jabber</title> |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
6 | <!--<link rel="self" type="text/atom" href=""/>--> |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
7 | <link rel="alternate" type="text/html" href="http://planet.jabber.org/"/> |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
8 | <id></id> |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
9 | <updated>2010-09-17T13:39:01+00:00</updated> |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
10 | <generator uri="http://www.planetplanet.org/">http://intertwingly.net/code/venus/</generator> |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
11 | <entry> |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
12 | <title>Fabio Forno: Glider Blackberry Beta is out</title> |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
13 | <link rel="alternate" type="text/html" href="http://blog.bluendo.com/ff/glider-blackberry-beta-is-out2"/> |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
14 | <id>http://blog.bluendo.com/ff/glider-blackberry-beta-is-out2</id> |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
15 | <updated>2010-09-15T12:26:10+00:00</updated> |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
16 | <content type="html"><p>After a long silence (and hard work) we are really excited for the release of the first beta of Glider for Blackberry. If you are impatient you can go directly <a href="http://www.mobihand.com/ProductPreview.asp?id=85809&amp;gnContentType=1">here</a> and download it.</p><p>This beta version is free and it will expire when new releases will be available. After the beta period you will have two options: a free ads supported version and a full pro version at an affordable price. </p><p>Glider is the multiplatform XMPP Client by Ooros, based on the open code of Lampiro. Glider exclusive features are:</p><ul><li>touchscreen support</li><li>blackberry device integration</li><li>simplified setup<br /></li><li>notifications of new messages when in background</li><li>automatic reconnect</li><li>network configuration</li><li>integrated news reader based on the efficient pubsub protocol <br /></li><li>moneiro: the Ooros platform for mobile payments</li></ul>Stay tuned, since very soon we will have news for Android and iPhone too!</content> |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
17 | <author> |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
18 | <name>Fabio Forno</name> |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
19 | <uri></uri> |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
20 | </author> |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
21 | </entry> |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
22 | </feed>]]; |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
23 | |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
24 | print(feed.title); |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
25 | print(""); |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
26 | |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
27 | for _, entry in ipairs(feed) do |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
28 | print(entry:get_child("title"):get_text()); |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
29 | print("", entry:get_child("link").attr.href); |
c04d4fd34685
demo_string.lua: Example opening a feed from a string
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
30 | end |