/[pg-getfeed]/getfeed.sql
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /getfeed.sql

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2 by dpavlin, Thu Mar 15 10:31:41 2007 UTC revision 3 by dpavlin, Sat Mar 15 21:06:51 2008 UTC
# Line 1  Line 1 
1  create type blog as (feed text, title text, content text, pubdate timestamptz, link text);  create type blog as (feed text, title text, content text, pubdate timestamptz, author text, link text);
2    
3  create or replace function getfeed(text)  create or replace function getfeed(text)
4  returns setof blog  returns setof blog
# Line 17  as $$ Line 17  as $$
17                          content => $entry->content->body,                          content => $entry->content->body,
18                          link => $entry->link,                          link => $entry->link,
19                          pubdate => $entry->issued,                          pubdate => $entry->issued,
20                            author => $entry->author,
21                  });                  });
22          }          }
23    
# Line 24  as $$ Line 25  as $$
25  $$;  $$;
26    
27  create view my_feeds as  create view my_feeds as
28  select feed,title,content,pubdate,link from getfeed('http://blog.rot13.org/index.xml')  select feed,author,title,content,pubdate,link from getfeed('http://blog.rot13.org/index.xml')
29  union  union
30  select feed,title,content,pubdate,link from getfeed('http://saturn.ffzg.hr/noauth/feed/workspace/rot13?category=Recent%20Changes;type=Atom')  select feed,author,title,content,pubdate,link from getfeed('http://saturn.ffzg.hr/noauth/feed/workspace/rot13?category=Recent%20Changes;type=Atom')
31  ;  ;
32    
33  -- if your terminal isn't iso-8859-2, change this!  -- if your terminal isn't iso-8859-2, change this!
# Line 39  from my_feeds Line 40  from my_feeds
40  ;  ;
41    
42  select  select
43          feed,title,substr(content,0,50),pubdate,link          feed,author,title,substr(content,0,50),pubdate,link
44  from feeds  from feeds
45  order by pubdate desc  order by pubdate desc
46  limit 30  limit 30

Legend:
Removed from v.2  
changed lines
  Added in v.3

  ViewVC Help
Powered by ViewVC 1.1.26