34
RSS on your website Using Drupal Views and Aggregator/Feeds (or Yahoo Pipes)

Rss on your_library_site

Embed Size (px)

Citation preview

Page 1: Rss on your_library_site

RSS on your website

Using Drupal Views and

Aggregator/Feeds (or Yahoo Pipes)

Page 2: Rss on your_library_site

Why RSS? – Start the Brainstorm

• Community News Portal – Consolidate school or local media feeds

• Reframe content from your catalog – RSS provided by your OPAC

• Present your own twitter or Facebook posts, without a widget, or as a mashup

• Create a ready-to-blog feed list• Legacy site import

Page 3: Rss on your_library_site

Drupal & RSS• Drupal is fine at producing RSS • Not as good at data mining from

RSS import

• Two basic import options: –Use Feeds module to create nodes

(content)– Import via Aggregator (sources)

In both cases: organize using Views

Both are CRON intensive, and imports need to expire

Page 4: Rss on your_library_site

Feeds Process• Select a content type to populate

from our feed• Create one if necessary using CCK• Create a feed importer using

the feed importer UI and our RSS source• Map the feed onto the content type• Import• Style and display

Page 5: Rss on your_library_site

Create a new content type with CCK• Adds function to the default content types

management pagehttp://www.example.com/admin/content/types

• Edit: Name and describe your new content type• Manage: Use Link submodule to add link

content field• Can use one universal link field but will need to

create unique label for each content type and use display fields to render label as link

• Don’t forget to set user permissions for each new content type

Page 6: Rss on your_library_site

CCK adds the “Add Content Type” function to the Content Types Page http://www.example.com/admin/content/types

Page 7: Rss on your_library_site

Inside the Calendar Item content type – Link Submodule provides “link” option in field types

Page 8: Rss on your_library_site

Unique label can be reset in manage fields

Page 9: Rss on your_library_site

Down the page in global settings we turn off the title

Page 10: Rss on your_library_site

Finally, use display fields to hide the label as a plain text field and instead use the label as the link

Page 11: Rss on your_library_site

Feeds – Create Nodes from Stuff

• Module creates “Feed importers” UI http://www.example.com/admin/build/feeds

• Clone (or override) an importer and edit• Choose attach to nothing (attach to node alters

the content type itself) and time to refresh• Using default templates, shouldn’t have to

change fetcher, parser or processor• Use Node Processor to select content type,

input format and settings to expire nodes• Use Mapping to assign fields to the chosen

content type

Page 12: Rss on your_library_site

Inside a feed importer: You will need to adjust Basic Settings, Node Processor and Mapping. Note the link for Import Page, we’ll get back to that.

Page 13: Rss on your_library_site

Basic Settings lets you set name and description and refresh time – don’t choose content type here, choose standalone form (and import from the import page -- http://www.example.com/import)

Page 14: Rss on your_library_site

Node Processor Settings is where you pick the content type to map the feed to, also set node expiration and the option to update or replace nodes – updates maintain comments, but are more server intensive. Import format lets you choose full html, which will show images in feeds if they exist.

Page 15: Rss on your_library_site

Finally, use Mapping to specify what you want to go where, including that Link submodule back to the source.

Page 16: Rss on your_library_site

The Import page for feeds. Click on a feed to import and then you finally get to add the URL.

Page 17: Rss on your_library_site

And here is a view of the finished calendar content type on the left, next to a differently styled view of an aggregator feed on the right

Page 18: Rss on your_library_site

Aggregator – Ockham’s Razor• Why use many tools when one will do?• Part of Drupal 6 core• Simple to use• Creates Feed Aggregator UI • http://www.example.com/admin/content/aggregator/

• Feeds are “sources,” not content, doesn’t allow comments

• Style and filter through Views into blocks or pages

• In settings, include <img> in allowed tags to have images included with feeds

Page 19: Rss on your_library_site

Aggregator: add feed, add category (here: news) and merge feeds by tagging them with the same category.

Page 20: Rss on your_library_site

Simple and all-in-one :Create a new feed with title, URL, update and category

Page 21: Rss on your_library_site

Unstyled Aggregator block

The “b” is available to any user with blog permission. It opens their blog and inserts a copy of the node and a link to the feed.

Page 22: Rss on your_library_site

Views – Essential Drupal Module• Can format data how you like to see it• All views can be multi-use: block, page,

even multi-page• Can use keyword filtering• Can use with aggregator feeds – choose

aggregator when selecting information style at creation

• Or node content (including imported via feeds module) – choose nodes at creation

• *//Whichever you choose cannot be undone//*

Page 23: Rss on your_library_site

The main Views screen http://www.example.com/admin/build/views

Page 24: Rss on your_library_site

Inside an advanced View: multiple pages and blocks, each using different keyword filters. In this view: exposed filters, selected fields, page path, menu, and a header.

Page 25: Rss on your_library_site

What that view looks like on a finished, themed page

Page 26: Rss on your_library_site

A Word on Keyword Filtering• Yahoo Pipes is very useful for catching errors

of input – can have redundant filters• Drupal logic is more exact

– Can filter node title AND node body, but cannot filter node title OR node body

– Each filter builds on previous (exclusionary)– Can assign taxonomy but cannot mine from content

– couple of modules may exist ‘somewhere out there,’ or maybe you can write custom php code

• Can Use Yahoo Pipes with Drupal, but third party reliance

Page 27: Rss on your_library_site

Exposed Filtering in Drupal

• By exposing a filter, you can let your users search

• Can set up more than one exposed filter: search by keyword and location

• Very useful with content created and associated with taxonomies, users – can filter by categories and give restricted options

• Not as useful if information is not associated

Page 28: Rss on your_library_site

Views – Style Matters• Unformatted gives unstyled list• HTML List – good for sidebars• Table gives attractive zebra striping (if

your theme allows)• Grid gives raw blocks• Use fields to cherry pick elements you

want: title, teaser, other data, leave out elements you don’t want (author, created date)

Page 29: Rss on your_library_site

A final word about CRON• RSS processes are server intensive and

require consistent updates• If you don’t have the ability to set

CRON on your server, add the Poormanscron module

• Try to set your updates for meaningful but not server-taxing cycles.

• If you don’t need your news to update more than once a day – don’t.

Page 30: Rss on your_library_site

Yahoo Pipes

• Extremely powerful – can mashup images, locations and create maps, use complex logic, more than just a text filter

• Easy to use – visual, interactive, drag and drop• Once set up can easily be cloned and keywords

just replaced• Very user friendly for keyword logic – allows

multiple filters on multiple parts of same content: title and body

• Downside is the pipes breaking and reliance on a third party

Page 31: Rss on your_library_site

Embedding Pipes in HTML• Pipes is a feature of any Yahoo account• Build your pipe and save it – don’t need to

publish to use• Choose “Get this as a Badge” and “Embed”• Copy & Paste the code in your HTML page• Script will inherit most CSS of the page• Set up extra CSS to create zebra striping,

blend frame background (badge customizing)

Page 32: Rss on your_library_site

An embedded Pipes Badge at http://www.myjcpl.org

Page 33: Rss on your_library_site

Links

Working with PipesYahoo Pipes: http://pipes.yahoo.comPipes Help Forum: http://discuss.pipes.yahoo.com Customizing Badges:

http://pipes.yahoo.com/pipes/badgedocsMy Pipes: http://pipes.yahoo.com/mwidner

Working with DrupalDrupal.org: http://www.drupal.org Lullabot: http://www.lullabot.com Learn By the Drop: http://learnbythedrop.com My Drupal Site: http://www.peacekaat.com

(link to JCPL Test Site)

Page 34: Rss on your_library_site

Modules we usedFeeds: http://drupal.org/project/feeds CCK: http://drupal.org/project/cck Link (CCK): http://drupal.org/project/link Views: http://drupal.org/project/views Aggregator (core):

http://drupal.org/documentation/modules/aggregator

Dependent Modules Ctools: http://drupal.org/project/ctools Job Scheduler: http://drupal.org/project/job_scheduler

ExtraPoormanscron: http://drupal.org/project/poormanscron