SlideShare une entreprise Scribd logo
1  sur  28
Télécharger pour lire hors ligne
How to RSS like a ninja
   Jason Austin - @jason_austin
On the agenda...

• What is RSS?
• Why should I use it?
• Creating RSS feeds
• Consuming RSS
• Tracking RSS performance
What is RSS?


• Way to share changing web content
• XML based
Why use RSS?

• Keep users up-to-date with fresh content
• Write once, use many
• Replace older subscription models
Use RSS for...

• ...blog posts!
• ...news articles
• ...forum and article comments
DO NOT use RSS for...

• ...a calendar feed
• ...a replacement for XML-based API’s
• ...static content
Types of RSS Feeds

• RSS 2.0
• RSS 1.0
• Atom
• ...lots more
RSS 2.0

• RSS 2.0 = Really Simple Syndication
• Most Popular
• Simplest
<?xml version="1.0"?>
<rss version="2.0">
<channel>
    <title>Ninja Academy</title>
    <link>http://ninjaacademy.com/</link>
    <description>The source for Ninjas</description>
    <item>
        <title>Throwing Stars</title>
        <link>http://ninjaacademy.com/stars</link>
        <description>How to throw stars</description>
    </item>
   <item>
        <title>Tips for Sneakery</title>
        <link>http://ninjaacademy.com/sneakery</link>
        <description>Be Sneaky My Friend</description>
    </item>
</channel>
RSS 1.0

• RSS 1.0 = RDF Site Summary
• RDF = Resource Description Framework
 • way of structuring metadata
• Consumption instructions are built in
<?xml version="1.0"?>
<rdf:RDF
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns="http://purl.org/rss/1.0/"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
>
   <channel rdf:about="http://ninjaacademy.com/news.rss">
     <title>Ninja Academy</title>
     <link>http://ninjaacademy.com/</link>
     <description>The Source For Ninjas</description>
     <items>
       <rdf:Seq>
         <rdf:li resource="http://ninjaacademy.com/stars/"/>
         <rdf:li resource="http://ninjaacademy.com/sneakery/"/>
       </rdf:Seq>
     </items>
   </channel>
   <item rdf:about="http://ninjaacademy.com/stars/">
      <title>Throwing Stars</title>
      <link>http://ninjaacademy.com/stars/</link>
      <description>How to Throw Stars</description>
      <dc:date>2002-09-01</dc:date>
   </item>
   <item rdf:about="http://ninjaacademy.com/sneakery/">
      <title>Tips for Sneakery</title>
      <link>http://ninjaacademy.com/sneakery/</link>
      <dc:date>2002-09-02</dc:date>
   </item>
</rdf:RDF>
Atom Feeds

• 2 types of Atom Specs
 • Atom Syndication Format
 • Atom Publishing Protocol
Atom Syndication Format


• XML based
• Used for web feeds
• Similar to RSS
Atom Publishing Protocol


• HTTP-based
• Standard for API-like services
• Used by Google’s GData APIs
Atom as a feed

• Intended to replace RSS
• Meant to clarify feed specs
• Not as widely adopted
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Ninja Academy</title>
  <link href="http://ninjaacademy.com/"/>
  <updated>2003-12-13T18:30:02Z</updated>
  <author>
    <name></name>
  </author>
  <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
  <entry>
    <title>Throwing Stars</title>
    <link href="http://ninjaacademy.com/stars/"/>
    <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
    <updated>2003-12-13T18:30:02Z</updated>
    <summary>How to throw stars.</summary>
  </entry>
  <entry>
    <title>Tips for Sneakery</title>
    <link href="http://ninjaacademy.com/sneakery/"/>
    <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
    <updated>2003-12-13T18:30:02Z</updated>
    <summary>Be Sneaky My Friend</summary>
  </entry>
</feed>
Choosing a Format

• Personal Choice
• Most syndicators can read all formats
• Don’t invent your own
Creating a feed

• Drupal, Wordpress, Joomla, etc.
• Create your own
 • Lots of OSS libraries in every language
 • Pretty easy to implement
<?php

$ncsu = new Tweets_Ncsu();

$timeline = $ncsu->getTimeline();

$feed = array();

$feed['title']     =   ‘NC State Tweets’;
$feed['link']      =   ‘http://twitter.ncsu.edu/feed.php';
$feed['charset']   =   'UTF-8';
$feed['author']    =   ‘NC State University’;
$feed[‘entries’]   =   array();

foreach ($timeline as $t) {
    $feed[‘entries’][] = array(
        'title'        => 'Tweet by @' . $t['user-screen_name'],
        'link'         => 'http://www.twitter.com/' . $t['user-screen_name'],
        'description' => $t['text'],
        'lastUpdate'   => strtotime($t['created_at']),
    );
}

// importing a rss feed from an array
$rssFeed = Zend_Feed::importArray($fa, 'rss');

// send http headers and dump the feed
$rssFeed->send();
Validate your feed
• w3c’s Feed Validator
  http://validator.w3.org/feed/
• Validates RSS 2.0 and Atom formats
Identifying RSS feeds
Finding feeds in code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">

<head>

<title>Jason Austin&#039;s Blog</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="wp-content/themes/lightword/original.css"
type="text/css" />
<link rel="shortcut icon" href="http://www.jasonawesome.com/favicon.ico" />


<link rel="alternate" type="application/rss+xml" title="RSS 2.0"
href="http://www.jasonawesome.com/feed/" />

<link rel="alternate" type="text/xml" title="RSS .92" href="http://
www.jasonawesome.com/feed/rss/" />

<link rel="alternate" type="application/atom+xml" title="Atom 1.0"
href="http://www.jasonawesome.com/feed/atom/" />


</head>
Consuming RSS

• Browsers
• RSS Readers like Google Reader
• Programmatically
<?php

$feed = new Zend_Feed_Rss(‘http://twitter.ncsu.edu/feed.php’);

foreach ($feed as $f) {
    echo ‘<a href="’ . $f->link . ‘">’ . $f->title . ‘</a><br />’;
    echo ‘<p>’ . $f->description . ‘</p>’;
}
Tracking RSS...

• Feedburner
 • Subscriber stats
 • Frequency stats
 • AdWords integration
The End

Slides on http://www.jasonawesome.com


     Jason Austin - @jason_austin

Contenu connexe

Tendances

WordPress Customization and Security
WordPress Customization and SecurityWordPress Customization and Security
WordPress Customization and Security
Joe Casabona
 
Chandra Prakash Thapa: Make a WordPress Multisite in 20 mins
Chandra Prakash Thapa: Make a WordPress Multisite in 20 minsChandra Prakash Thapa: Make a WordPress Multisite in 20 mins
Chandra Prakash Thapa: Make a WordPress Multisite in 20 mins
wpnepal
 
Worcamp2012 make a wordpress multisite in 20mins
Worcamp2012 make a wordpress multisite in 20minsWorcamp2012 make a wordpress multisite in 20mins
Worcamp2012 make a wordpress multisite in 20mins
Chandra Prakash Thapa
 

Tendances (20)

Web Scraping In Ruby Utosc 2009.Key
Web Scraping In Ruby Utosc 2009.KeyWeb Scraping In Ruby Utosc 2009.Key
Web Scraping In Ruby Utosc 2009.Key
 
WordPress Theme Development
 WordPress Theme Development WordPress Theme Development
WordPress Theme Development
 
Django REST Framework
Django REST FrameworkDjango REST Framework
Django REST Framework
 
WordPress Customization and Security
WordPress Customization and SecurityWordPress Customization and Security
WordPress Customization and Security
 
NEPA BlogCon 2013 - WordPress Customization & Security
NEPA BlogCon 2013 - WordPress Customization & SecurityNEPA BlogCon 2013 - WordPress Customization & Security
NEPA BlogCon 2013 - WordPress Customization & Security
 
Make your website 2 times faster
Make your website 2 times fasterMake your website 2 times faster
Make your website 2 times faster
 
Chandra Prakash Thapa: Make a WordPress Multisite in 20 mins
Chandra Prakash Thapa: Make a WordPress Multisite in 20 minsChandra Prakash Thapa: Make a WordPress Multisite in 20 mins
Chandra Prakash Thapa: Make a WordPress Multisite in 20 mins
 
Intro to WordPress theme development
Intro to WordPress theme developmentIntro to WordPress theme development
Intro to WordPress theme development
 
Installing And Configuration for your Wordpress blog
Installing And Configuration for your Wordpress blogInstalling And Configuration for your Wordpress blog
Installing And Configuration for your Wordpress blog
 
Secure your site
Secure your siteSecure your site
Secure your site
 
Drupal Security Intro
Drupal Security IntroDrupal Security Intro
Drupal Security Intro
 
Get Django, Get Hired - An opinionated guide to getting the best job, for the...
Get Django, Get Hired - An opinionated guide to getting the best job, for the...Get Django, Get Hired - An opinionated guide to getting the best job, for the...
Get Django, Get Hired - An opinionated guide to getting the best job, for the...
 
Cms & wordpress theme development 2011
Cms & wordpress theme development 2011Cms & wordpress theme development 2011
Cms & wordpress theme development 2011
 
How to Contribute Code to MySQL?
How to Contribute Code to MySQL?How to Contribute Code to MySQL?
How to Contribute Code to MySQL?
 
Djangocon 2014 angular + django
Djangocon 2014 angular + djangoDjangocon 2014 angular + django
Djangocon 2014 angular + django
 
The JSON REST API for WordPress
The JSON REST API for WordPressThe JSON REST API for WordPress
The JSON REST API for WordPress
 
Webcrawler
WebcrawlerWebcrawler
Webcrawler
 
Worcamp2012 make a wordpress multisite in 20mins
Worcamp2012 make a wordpress multisite in 20minsWorcamp2012 make a wordpress multisite in 20mins
Worcamp2012 make a wordpress multisite in 20mins
 
Small wins in a small time with Apache Solr
Small wins in a small time with Apache SolrSmall wins in a small time with Apache Solr
Small wins in a small time with Apache Solr
 
My sql indo_comm
My sql indo_commMy sql indo_comm
My sql indo_comm
 

Similaire à RSS Like A Ninja

Semantic web support for POSH
Semantic web support for POSHSemantic web support for POSH
Semantic web support for POSH
Dinu Suman
 
Microformats, Institute of Engineering and Technology
Microformats, Institute of Engineering and TechnologyMicroformats, Institute of Engineering and Technology
Microformats, Institute of Engineering and Technology
Nishikant Taksande
 

Similaire à RSS Like A Ninja (20)

Construindo APIs Usando Rails
Construindo APIs Usando RailsConstruindo APIs Usando Rails
Construindo APIs Usando Rails
 
Documentation 2.0: DIY Content Delivery and Feedback in Real-time
Documentation 2.0: DIY Content Delivery and Feedback in Real-timeDocumentation 2.0: DIY Content Delivery and Feedback in Real-time
Documentation 2.0: DIY Content Delivery and Feedback in Real-time
 
Semantic web support for POSH
Semantic web support for POSHSemantic web support for POSH
Semantic web support for POSH
 
Rails 4.0
Rails 4.0Rails 4.0
Rails 4.0
 
REST teori og praksis; REST in theory and practice
REST teori og praksis; REST in theory and practiceREST teori og praksis; REST in theory and practice
REST teori og praksis; REST in theory and practice
 
Using Sinatra to Build REST APIs in Ruby
Using Sinatra to Build REST APIs in RubyUsing Sinatra to Build REST APIs in Ruby
Using Sinatra to Build REST APIs in Ruby
 
Microformats, Institute of Engineering and Technology
Microformats, Institute of Engineering and TechnologyMicroformats, Institute of Engineering and Technology
Microformats, Institute of Engineering and Technology
 
Introduction of Feedy
Introduction of FeedyIntroduction of Feedy
Introduction of Feedy
 
Introduction to blogging with Jekyll
Introduction to blogging with JekyllIntroduction to blogging with Jekyll
Introduction to blogging with Jekyll
 
Spark Sql for Training
Spark Sql for TrainingSpark Sql for Training
Spark Sql for Training
 
Moz SEO Web cheat sheet 2016
Moz SEO Web cheat sheet 2016Moz SEO Web cheat sheet 2016
Moz SEO Web cheat sheet 2016
 
Seo cheat-sheet
Seo cheat-sheetSeo cheat-sheet
Seo cheat-sheet
 
The Web Developer's SEO Cheat Sheet
The Web Developer's SEO Cheat Sheet The Web Developer's SEO Cheat Sheet
The Web Developer's SEO Cheat Sheet
 
Seo cheat sheet
Seo cheat sheetSeo cheat sheet
Seo cheat sheet
 
Seo cheat sheet
Seo cheat sheetSeo cheat sheet
Seo cheat sheet
 
Seo cheat-sheet
Seo cheat-sheetSeo cheat-sheet
Seo cheat-sheet
 
Seo onpage for Developer
Seo onpage for DeveloperSeo onpage for Developer
Seo onpage for Developer
 
Seo Cheat Sheet
Seo Cheat SheetSeo Cheat Sheet
Seo Cheat Sheet
 
Seo cheat-sheet
Seo cheat-sheetSeo cheat-sheet
Seo cheat-sheet
 
Site optimization
Site optimizationSite optimization
Site optimization
 

Plus de Jason Austin

Plus de Jason Austin (12)

Introduction to Elasticsearch
Introduction to ElasticsearchIntroduction to Elasticsearch
Introduction to Elasticsearch
 
Service Oriented Architecture
Service Oriented ArchitectureService Oriented Architecture
Service Oriented Architecture
 
Design patterns
Design patternsDesign patterns
Design patterns
 
How Beer Made Me A Better Developer
How Beer Made Me A Better DeveloperHow Beer Made Me A Better Developer
How Beer Made Me A Better Developer
 
Securing Your API
Securing Your APISecuring Your API
Securing Your API
 
Preparing Traditional Media for a Mobile World
Preparing Traditional Media for a Mobile WorldPreparing Traditional Media for a Mobile World
Preparing Traditional Media for a Mobile World
 
Object Oriented PHP5
Object Oriented PHP5Object Oriented PHP5
Object Oriented PHP5
 
UNC CAUSE - Going Mobile On Campus
UNC CAUSE - Going Mobile On CampusUNC CAUSE - Going Mobile On Campus
UNC CAUSE - Going Mobile On Campus
 
Lean mean php machine
Lean mean php machineLean mean php machine
Lean mean php machine
 
Web Hosting Pilot - NC State University
Web Hosting Pilot - NC State UniversityWeb Hosting Pilot - NC State University
Web Hosting Pilot - NC State University
 
Tweeting For NC State University
Tweeting For NC State UniversityTweeting For NC State University
Tweeting For NC State University
 
Pathways Project on NCSU Web Dev
Pathways Project on NCSU Web DevPathways Project on NCSU Web Dev
Pathways Project on NCSU Web Dev
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

RSS Like A Ninja

  • 1. How to RSS like a ninja Jason Austin - @jason_austin
  • 2. On the agenda... • What is RSS? • Why should I use it? • Creating RSS feeds • Consuming RSS • Tracking RSS performance
  • 3. What is RSS? • Way to share changing web content • XML based
  • 4. Why use RSS? • Keep users up-to-date with fresh content • Write once, use many • Replace older subscription models
  • 5. Use RSS for... • ...blog posts! • ...news articles • ...forum and article comments
  • 6. DO NOT use RSS for... • ...a calendar feed • ...a replacement for XML-based API’s • ...static content
  • 7. Types of RSS Feeds • RSS 2.0 • RSS 1.0 • Atom • ...lots more
  • 8. RSS 2.0 • RSS 2.0 = Really Simple Syndication • Most Popular • Simplest
  • 9. <?xml version="1.0"?> <rss version="2.0"> <channel> <title>Ninja Academy</title> <link>http://ninjaacademy.com/</link> <description>The source for Ninjas</description> <item> <title>Throwing Stars</title> <link>http://ninjaacademy.com/stars</link> <description>How to throw stars</description> </item> <item> <title>Tips for Sneakery</title> <link>http://ninjaacademy.com/sneakery</link> <description>Be Sneaky My Friend</description> </item> </channel>
  • 10. RSS 1.0 • RSS 1.0 = RDF Site Summary • RDF = Resource Description Framework • way of structuring metadata • Consumption instructions are built in
  • 11. <?xml version="1.0"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" > <channel rdf:about="http://ninjaacademy.com/news.rss"> <title>Ninja Academy</title> <link>http://ninjaacademy.com/</link> <description>The Source For Ninjas</description> <items> <rdf:Seq> <rdf:li resource="http://ninjaacademy.com/stars/"/> <rdf:li resource="http://ninjaacademy.com/sneakery/"/> </rdf:Seq> </items> </channel> <item rdf:about="http://ninjaacademy.com/stars/"> <title>Throwing Stars</title> <link>http://ninjaacademy.com/stars/</link> <description>How to Throw Stars</description> <dc:date>2002-09-01</dc:date> </item> <item rdf:about="http://ninjaacademy.com/sneakery/"> <title>Tips for Sneakery</title> <link>http://ninjaacademy.com/sneakery/</link> <dc:date>2002-09-02</dc:date> </item> </rdf:RDF>
  • 12. Atom Feeds • 2 types of Atom Specs • Atom Syndication Format • Atom Publishing Protocol
  • 13. Atom Syndication Format • XML based • Used for web feeds • Similar to RSS
  • 14. Atom Publishing Protocol • HTTP-based • Standard for API-like services • Used by Google’s GData APIs
  • 15. Atom as a feed • Intended to replace RSS • Meant to clarify feed specs • Not as widely adopted
  • 16. <?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> <title>Ninja Academy</title> <link href="http://ninjaacademy.com/"/> <updated>2003-12-13T18:30:02Z</updated> <author> <name></name> </author> <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id> <entry> <title>Throwing Stars</title> <link href="http://ninjaacademy.com/stars/"/> <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id> <updated>2003-12-13T18:30:02Z</updated> <summary>How to throw stars.</summary> </entry> <entry> <title>Tips for Sneakery</title> <link href="http://ninjaacademy.com/sneakery/"/> <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id> <updated>2003-12-13T18:30:02Z</updated> <summary>Be Sneaky My Friend</summary> </entry> </feed>
  • 17. Choosing a Format • Personal Choice • Most syndicators can read all formats • Don’t invent your own
  • 18. Creating a feed • Drupal, Wordpress, Joomla, etc. • Create your own • Lots of OSS libraries in every language • Pretty easy to implement
  • 19. <?php $ncsu = new Tweets_Ncsu(); $timeline = $ncsu->getTimeline(); $feed = array(); $feed['title'] = ‘NC State Tweets’; $feed['link'] = ‘http://twitter.ncsu.edu/feed.php'; $feed['charset'] = 'UTF-8'; $feed['author'] = ‘NC State University’; $feed[‘entries’] = array(); foreach ($timeline as $t) { $feed[‘entries’][] = array( 'title' => 'Tweet by @' . $t['user-screen_name'], 'link' => 'http://www.twitter.com/' . $t['user-screen_name'], 'description' => $t['text'], 'lastUpdate' => strtotime($t['created_at']), ); } // importing a rss feed from an array $rssFeed = Zend_Feed::importArray($fa, 'rss'); // send http headers and dump the feed $rssFeed->send();
  • 20. Validate your feed • w3c’s Feed Validator http://validator.w3.org/feed/ • Validates RSS 2.0 and Atom formats
  • 22. Finding feeds in code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"> <head> <title>Jason Austin&#039;s Blog</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" href="wp-content/themes/lightword/original.css" type="text/css" /> <link rel="shortcut icon" href="http://www.jasonawesome.com/favicon.ico" /> <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://www.jasonawesome.com/feed/" /> <link rel="alternate" type="text/xml" title="RSS .92" href="http:// www.jasonawesome.com/feed/rss/" /> <link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="http://www.jasonawesome.com/feed/atom/" /> </head>
  • 23. Consuming RSS • Browsers • RSS Readers like Google Reader • Programmatically
  • 24.
  • 25. <?php $feed = new Zend_Feed_Rss(‘http://twitter.ncsu.edu/feed.php’); foreach ($feed as $f) { echo ‘<a href="’ . $f->link . ‘">’ . $f->title . ‘</a><br />’; echo ‘<p>’ . $f->description . ‘</p>’; }
  • 26. Tracking RSS... • Feedburner • Subscriber stats • Frequency stats • AdWords integration
  • 27.
  • 28. The End Slides on http://www.jasonawesome.com Jason Austin - @jason_austin