turbot / steampipe-plugin-rss

Use SQL to instantly query RSS channels and Atom Feeds. Open source CLI. No DB required.
https://hub.steampipe.io/plugins/turbot/rss
Apache License 2.0
11 stars 2 forks source link

Add example of querying multiple feeds from a CSV file #19

Closed e-gineer closed 2 years ago

e-gineer commented 2 years ago

Here is a full example of how to query multiple feeds in a CSV file. We should add a simpler version of this to the docs:

/tmp/demo $ cat feeds.csv 
uri
https://steampipe.io/blog/feed.xml
http://scripting.com/rss.xml
https://rss.art19.com/apology-line
http://rss.art19.com/the-daily
https://feeds.fireside.fm/bibleinayear/rss
https://feeds.megaphone.fm/ADL9840290619
http://feeds.wnyc.org/experiment_podcast
/tmp/demo $ steampipe query
Welcome to Steampipe v0.14.4-rc.0
For more information, type .help
> select * from feeds
+--------------------------------------------+---------------------------+
| uri                                        | _ctx                      |
+--------------------------------------------+---------------------------+
| https://feeds.fireside.fm/bibleinayear/rss | {"connection_name":"csv"} |
| https://rss.art19.com/apology-line         | {"connection_name":"csv"} |
| https://steampipe.io/blog/feed.xml         | {"connection_name":"csv"} |
| http://feeds.wnyc.org/experiment_podcast   | {"connection_name":"csv"} |
| http://scripting.com/rss.xml               | {"connection_name":"csv"} |
| https://feeds.megaphone.fm/ADL9840290619   | {"connection_name":"csv"} |
| http://rss.art19.com/the-daily             | {"connection_name":"csv"} |
+--------------------------------------------+---------------------------+

Time: 80.980125ms
> select published, title, author_name, feed_link
  from feeds join rss_item on feed_link = uri
  limit 5;
+---------------------------+------------------------------------------------+------------------------------------+-----
| published                 | title                                          | author_name                        | feed
+---------------------------+------------------------------------------------+------------------------------------+-----
| 2022-04-21T09:30:00+05:30 | Day 111: Saul Tries to Kill David (2022)       | Ascension Catholic Faith Formation | http
| 2022-04-29T09:30:00+05:30 | Day 119: David's Wisdom (2022)                 | Ascension Catholic Faith Formation | http
| 2022-05-07T09:30:00+05:30 | Day 127: Kindness for the House of Saul (2022) | Ascension Catholic Faith Formation | http
| 2022-04-18T09:30:00+05:30 | Day 108: Saul's Vanity (2022)                  | Ascension Catholic Faith Formation | http
| 2022-04-27T09:30:00+05:30 | Day 117: Reverence and Faithfulness (2022)     | Ascension Catholic Faith Formation | http
+---------------------------+------------------------------------------------+------------------------------------+-----

Time: 12.359159375s
> select date_trunc('year', published) as pub_date, count(*)
  from feeds join rss_item on feed_link = uri
  group by pub_date
  order by pub_date desc;
+---------------------------+-------+
| pub_date                  | count |
+---------------------------+-------+
| 2022-01-01T05:30:00+05:30 | 351   |
| 2021-01-01T05:30:00+05:30 | 819   |
| 2020-01-01T05:30:00+05:30 | 382   |
| 2019-01-01T05:30:00+05:30 | 330   |
| 2018-01-01T05:30:00+05:30 | 323   |
| 2017-01-01T05:30:00+05:30 | 240   |
+---------------------------+-------+

Time: 11.790391792s
> 
github-actions[bot] commented 2 years ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] commented 2 years ago

This issue was closed because it has been stalled for 90 days with no activity.