You are not logged in.
Ok, I've got some good new, and some bad news...
The good news is that I've added support for the etag and last-modified attributes...
The bad news is that while doing that, I realized just how bad the code was and started to restructure it. It started well and I managed to centralize the feed retrieval quite nicely (imo at the time), but towards the end of restructuring the Aggregator class and modularizing the XHTML generation, it started to feel a bit hacky, but I was fairly tired by this point.
So, all in all, it should be better now, but the template parser has completely changed and the old templates won't work. I've probably introduced some bugs too. Back up your old files, then clear everything out from the config dir except the configuration file. Run it then take a look at the new template file.
The new default theme was obviously inspired by kinhodder's above. Feel free to clean it up or submit other themes.
rambling... need to sleep...
*edit: typo*
Last edited by Xyne (2011-04-04 04:04:52)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
heh, sorry!
Offline
heh, sorry!
Don't be, it needed some denoobing. Just let me know if it works as expected.
Feedback on the new template file format would be appreciated, e.g. if it's easier to work with.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
I get a
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 530, in __bootstrap_inner
self.run()
File "/usr/bin/voracious", line 338, in run
for url, rtime in self.rtimes.iteritems():
RuntimeError: dictionary changed size during iteration
when I refresh a group after not refreshing for a while.
----
also, where in the template can I stick javascript stuff
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
<script>
$(document).ready(function(){
alert("hello");
});
</script>
jquery gets loaded, but I don't see the second script in the page source. This is when I put the above script tags just before </content> in the template.
Offline
The first error should be fixed now. I've also modified the template format again to support additional head tags.
Here's a template that includes your Javascript:
<template>
<head>
</head>
<body>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
<script type="text/javascript"><![CDATA[
$(document).ready(function(){
alert("hello");
});
]]></script>
<h1>Voracious</h1>
<voracious_navbar />
<voracious_entry type="entry" voracious_class="CLASS">
<div>
<div class="header">
<a voracious_href="entry.link">
<voracious_text value="entry.title" />
</a>
</div>
<div class="meta">
<a voracious_href="feed.link">
<voracious_text value="feed.title" />
</a>
<voracious_text value="entry.date_parsed" />
</div>
<div class="summary">
<voracious_text value="entry.summary; entry.content" />
</div>
</div>
</voracious_entry>
</body>
</template>
Note the use of the CDATA tags. This is slightly different than pure XHTML, which would require comments, because the Python XML parser is a bit tricky. It will output validated XHTML though.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
Hi,
Just trying this. Seems the makedir done when the config directory is not present is not working:
Traceback (most recent call last):
File "/usr/bin/voracious", line 1489, in <module>
main()
File "/usr/bin/voracious", line 1469, in main
server.aggregator = Aggregator(request_queue, log_message, options)
File "/usr/bin/voracious", line 1120, in __init__
create_file_if_absent(config_path, DEFAULT_CONFIG)
File "/usr/bin/voracious", line 204, in create_file_if_absent
os.path.makedirs(dpath)
AttributeError: 'module' object has no attribute 'makedirs'
I've been able to workaround this by doing a simple:
mkdir $XDG_CONFIG_HOME/voracious
Edit:
And a quick question? Would there be a way to display the web page content (ie web page located at entry.link) instead of the feed entry? This would be especially useful when the feed only embed a link to the corresponding article.
Last edited by X-dark (2011-04-08 12:29:41)
Cedric Girard
Offline
My javascript is ummm....well, anyway, I hacked on the old template and voracious code to add 'Next' 'Prev' and 'Home' buttons to each entry (makes scanning headlines much more painless on my phone!). Anyone worked out a javascript solution to this that can be part of the template if desired, as opposed to hacking the source code?
Thanks!
Scott
Offline
Hi,
Just trying this. Seems the makedir done when the config directory is not present is not working:Traceback (most recent call last): File "/usr/bin/voracious", line 1489, in <module> main() File "/usr/bin/voracious", line 1469, in main server.aggregator = Aggregator(request_queue, log_message, options) File "/usr/bin/voracious", line 1120, in __init__ create_file_if_absent(config_path, DEFAULT_CONFIG) File "/usr/bin/voracious", line 204, in create_file_if_absent os.path.makedirs(dpath) AttributeError: 'module' object has no attribute 'makedirs'
That should be fixed now. Thanks for reporting it.
And a quick question? Would there be a way to display the web page content (ie web page located at entry.link) instead of the feed entry? This would be especially useful when the feed only embed a link to the corresponding article.
When I first read the question, I thought "hmmm, interesting idea, I should implement that".... but then when I looked at the code, I realized that it was already possible.
I've posted a template on the project page that replaces the summary with the entry.link page: http://xyne.archlinux.ca/projects/vorac … dded-pages
You'll probably want to modify the template to change the size of the embedded page, but it should be easy to do.
Last edited by Xyne (2011-04-08 19:35:12)
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
My javascript is ummm....well, anyway, I hacked on the old template and voracious code to add 'Next' 'Prev' and 'Home' buttons to each entry (makes scanning headlines much more painless on my phone!). Anyone worked out a javascript solution to this that can be part of the template if desired, as opposed to hacking the source code?
Thanks!
Scott
I missed your post when I replied earlier.
I've added a new interpolation value named "ENTRY_ID". That should eliminate the need to hack the source code. The new default template uses it to create a unique, sequential id for each entry in the list. You could also use it to create local anchors with the "a" tag.
The rest should be possible with template XHTML and some Javascript.
My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone
Offline
That should be fixed now. Thanks for reporting it.
Thanks.
When I first read the question, I thought "hmmm, interesting idea, I should implement that".... but then when I looked at the code, I realized that it was already possible.
I've posted a template on the project page that replaces the summary with the entry.link page: http://xyne.archlinux.ca/projects/vorac … dded-pages
You'll probably want to modify the template to change the size of the embedded page, but it should be easy to do.
Perfect. I'll look to improve the appearance a bit but this is the behavior I wanted (I'm using Thunderbird for RSS reading for a long time and it's the default behavior).
Cedric Girard
Offline