Hi all!
I've started playing with Conky recently and wanted to customize the appearance of rss feed. It shows up allright, the only problem is that I can't find how to add some info to it. I.e., what if I want something like this:
[date] title (author)
first few lines of text
Say, latest 5 posts...
Now, the standard rss parser only can do titles and I dan't find any examples of more advanced display.
Did anyone write something similar to it? If not, can someone please link/show samples of how to customize the rss parsing (bash / perl script?), just to get started...
Conky rss with more info than just title [SOLVED]
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Conky rss with more info than just title [SOLVED]
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Conky rss with more info than just title
OK, I actually figured it out myself (not completed yet, but have some start). Maybe not the best solution, but here you go.
rss.py
In .conkyrc text area added this:
It properly formats Conky output as:
etc...
rss.py
Code: Select all
import feedparser
import datetime as dt
feed = feedparser.parse("http://addressofmyfeed")
for i in range(20):
print "[" + dt.datetime.strftime(dt.datetime.strptime(feed["items"][i]["published"][:-6].rstrip(), "%a, %d %b %Y %H:%M:%S"), "%d %b %Y") + "]" + " " + feed["items"][i]["title"]
Code: Select all
${exec python ~/rss.py}
Code: Select all
[13 Aug 2013] New thing happened!
[10 Aug 2013] Some blog post title here
[07 Aug 2013] This is what I think
Re: Conky rss with more info than just title
Great Job crafting a solution!sashkello wrote:OK, I actually figured it out myself (not completed yet, but have some start). Maybe not the best solution, but here you go.
It doesn't have to be the "best" as that is subjective.