eScience Lectures Notes : XML, RSS etc
Slide 1 : 1/19: XML RSS etc
COMP1710 Tools for New Media and Web
XML RSS etc
then 'n'ext or 'b'ack
Slide 2 : ToC : XML, RSS etc
Table of Contents (19 slides) for the presentation :
XML, RSS etc
Slide 3 : 3/19: XML, RSS, podcasts etc
In this lecture:
XML, RSS, podcasts etc
XML: eXtensible Markup Language
RSS: Really Simple Syndication
Podcasts: sound on the Web
Slide 4 : 4/19: Intro to XML
eXtensible Markup Language (XML)
is a standard which defines the
syntax for document
markup. (See
also the Markdown
language
.)
XML can be used by all sorts of documents, including:
- Web pages,
- Vector graphics,
- Legal documents,
- word processor documents,
- real estate listings, etc
XML understood by a variety of platforms:`
- desktop machines,
- mobile phones,
- games machines, etc
XML can be used to communicate between computing platforms
Many libraries for programmers to use
References: XML content mostly from a guest lecture by Eric McCreath
Slide 5 : 5/19: XML Format
XML Format
XML is plain text with tags to mark up the contents
<person>
Tom Gedeon
</person>
(Tags must match, but names can be user chosen.)
<person>
<personal_name>Tom</personal_name>
<family_name>Gedeon</family_name>
<phone_extension>51052</phone_extension>
</person>
(No white space in the tag names.)
Slide 6 : 6/19: XML declaration
XML documents should have an XML declaration on the first line,
although this is not strictly needed
<?xml version="1.0" encoding="US-ASCII" standalone="yes"?>
<person>
<personal_name>Tom</personal_name>
<family_name>Gedeon</family_name>
<phone_number>51052</phone_number>
</person>
XML documents should be well formed (conform to XML syntax rules):
- Start tags matching end tags,
- Elements not overlapping,
- Tags are case sensitive
(<p> is different from <P>!)
- XML documents must have a root element, and
- XML attribute values must always be quoted
XML documents should be valid (conform to some
semantic
rules).
Slide 7 : 7/19: More XML stuff
Other items you may find in XML documents:
Empty elements
- all 3 of these are the same:
- <mac_user></mac_user>
- <mac_user />
- <mac_user/>
Processing instructions
Tag attributes
<person>
<mac_user/>
<personal_name><?php print $name; ?></personal_name>
<phone_number type="ext">51052</phone_number>
</person>
Slide 8 : 8/19: XHTML
XHTML
XHTML is an XML version of HTML
HTML is already a lot like XML, with some minor textual but
important differences:
-
XHTML elements must be properly nested
-
XHTML elements must always be closed
E.g. This is incorrect XHTML:
A break: <br>
A horizontal rule: <hr>
An image: <img src="happy.gif" alt="Happy face">
While this is correct XHTML:
A break: <br />
A horizontal rule: <hr />
An image: <img src="happy.gif" alt="Happy face" />
-
XHTML elements must be in lowercase
-
XHTML documents must have one root element
See also the W3C
HTML and XHTML FAQ.
Slide 9 : 9/19: HTML vs XHTML
You have to look closely to notice the difference:
Slide 10 : 10/19: XML on the Web
XML on the Web
XML may be served up directly from a web server along with a CSS
style sheet
The browser can transform the XML into HTML (or XHTML)
Slide 11 : 11/19: RSS: Really Simple Syndication
RSS: Really Simple Syndication
RSS is an XML format for publishing short news-like articles
Is used in a number of different ways:
Aggregators are also referred to as
- RSS readers,
- feed readers,
- feed aggregators,
- news readers or
- search aggregators.
Slide 12 : 12/19: Using RSS feeds
Using RSS feeds
Benefits of using RSS feeds: you don't have the overhead of
loading the entire website if you only want to read headline news or
just the newest blog post from your friend.
Easiest way to use: modern browsers supports RSS subscription. This
is called Live Bookmark.
Web based aggregators (e.g.
Google Reader or
Bloglines) which enable
you to organise a number of different RSS feeds. They highlight
unread items and give you a uniform organised interface into
this information.
Benefit - your list of feeds won't be tied to one computer, since
it is all kept on the web, you'll never loose your info
Desktop aggregators - applictions you have to download, they manage
your feeds similarly to Mail readers manage your email
Benefit - does not clutter your bookmarks, downloaded info is kept
on your computer so you don't need to be online to access old ones.
If Internet connection access time is limited, you can get online,
update your feeds, then unplug and read all the news you want.
Reference
Slide 13 : 13/19: RSS format
RSS is a very simple XML format
A feed comprises a channel, which has a title, link, description, and (optional) language, followed by a series of items, each of which have a title, link, and description.
Here is a fictitious COMP1710 RSS feed:
<rss version="0.91">
<channel>
<title>COMP1710 News</title>
<link>http://cs.anu.edu.au/students/comp1710.com/</link>
<description>Features COMP1710 news.</description>
<language>en-us</language>
<item>
<title>Last week of Lectures!</title>
<link>http://escience.anu.edu.au/nm</link>
<description>The last lecture reviews the course and has exam hints.</description>
</item>
<item>
<title>Lab marks</title>
<link>http://cs.anu.edu.au/streams</link>
<description>Please check you lab marks, a blank means nothing was submitted.</description>
</item>
</channel>
</rss>
The RSS 2.0 format is slightly more verbose.
Reference: sample
RSS
channel.
Slide 14 : 14/19: Push technology
Push technology
Push: a communication protocol - request
comes from the publisher, or central server
Pull: request originates with the receiver, or client.
Examples of push:
- instant messaging (also SMS)
- e-mail (except for last step)
All "true" push media present practical difficulties because the
server is responsible for remembering who the subscribers are,
and
for remembering the latest address that each subscriber should be
contacted at.
Examples of pull:
- web browsing
- RSS (looks like push but aggregator polls regularly so is pull)
Reference: Wikipedia on
push
technology
Slide 15 : 15/19: Sound: What For?
Sound: What For ?
Conveying Information
After action from the user
Setting a Mood / Providing personal touch
Capture attention
This should be used carefully ...
Explaining a process
Usually, with a video or animation
Slide 16 : 16/19: Podcasting
Podcasting is just audio via RSS
Components:
- Record audio
- Convert to MP3
- Edit ID3 tags
An MP3 file contains information about the artist, album, genre,
etc. This info is stored in what is called ID3 tags. iTunes and
Windows Media Player use these tags to organize your MP3s. Your ID3
tags should have your podcast's name and your web site at the very least,
so they can find your site even if all they have is one of your MP3 files.
- Setup RSS feed
- Podcatching software (most popular is
iTunes)
A Video podcast is just video via RSS ...
Slide 17 : 17/19: Twitter and other microblogging services
Twitter and other microblogging services
What?
"Twitter is a service for friends, family, and co-workers to
communicate and stay connected through the exchange of quick, frequent
answers to one simple question: What are you doing?"
Wikipedia says Twitter has been described as akin to a web-based
IRC
client.
Twitter uses the Ruby
on Rails web framework.
Twitter messages may be tagged using hashtags, a word or phrase
prefixed with a #, such as #beer.This enables tweets on a specific
subject to be found by simply searching for their common hashtag,
provided that the user has tagged his or her tweet.
The @ sign before a username, such as @example, is used to
distinguish a reply directed at a particular user. A message preceded
by the @username prefix can still be read by anyone, but is treated as
directed firstly to the user in question
"In February 2009, the Australian Country Fire Authority used
Twitter to send out regular alerts and updates regarding
the 2009 Victorian bushfires.
During this time the Prime Minister of Australia,
Kevin Rudd, also
used his Twitter account to send out information on the fires, how to
donate money and blood, and where to seek emergency help."
Private information:
"Twitter may sell, transfer or otherwise share some or all of its
assets, including your personally identifiable information, in
connection with a merger, acquisition, reorganization or sale of
assets or in the event of bankruptcy."
Many Twitter look-alikes, extensions
Slide 18 : 18/19: Mashups
Mashups recombine and modify existing digital media
-
Mashup (digital):
a digital media file containing any or all of text,
graphics, audio, video, and animation, which recombines and modifies
existing digital works to create a derivative work
-
Mashup (music):
the musical genre encompassing songs which consist
entirely of parts of other songs
-
Mashup (video):
a video that is edited from more than one source to
appear as one
E.g. Searchles.
-
Mashup (web application hybrid):
a web application that combines data
and/or functionality from more than one source
E.g. Images+Maps
E.g. Yahoo Pipes.
Slide 19 : ToC : XML, RSS etc
Table of Contents (19 slides) for the presentation :
XML, RSS etc