Hi Merc, adding ?q=feed to a page enables me to get an RSS feed. Of course, it's a great way to get people to come back to the site.
I think it would be very useful if we could get the vote button into the feed so that people can vote directly from Netvibes, Google Reader & such
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | Capture07-08-2008-09.22.58.jpg | 109.24 KB | PGiro |
Comments
Comment #1
mercmobily commentedHi,
I never even thought of this.
It would actually be quite possible to do this, and in fact easy. But, the voting form is all based on Javascript. Would it actually look right? Where would it be placed, display-wise?
Has this been done before? I have just _never_ seen a JS-aware widget in an RSS feed.
Anyone?
Merc.
Comment #2
PGiro commentedWell, feedbruner adds stuff to RSS feeds although maybe readers block JS, I haven't thought about it. But it would be really great to make voting that much viral !
For sure, displaying an image of the voting button would work... In fact, I will need to do this on my install because the main blogging platform in France doesn't allow JS widgets
Comment #3
mercmobily commentedHi,
I am not actually sure this is possible after all...
All drigg does, is call this function:
node_feed($result, $channel);
http://api.drupal.org/api/function/node_feed/5
Which then renders the feed.
I haven't seen any Drupal theme capability about it... Drupal eventually will run this for each item:
http://api.drupal.org/api/function/format_rss_item/5
Ah wait, there is a hook called for this:
$extra = node_invoke_nodeapi($item, 'rss item');
So yes, all you have to do, really, is write a hook that will change the item and adds the voting form at the beginning.
However, I doubt this should be a standard Drigg thing. MAYBE if I manage to make it look OK, it could become a checkbox to tick... would it work?
Merc.
Bye,
Merc.
Comment #4
PGiro commentedAbsolutly !
Comment #5
mercmobily commentedHi,
OK assigning this to myself.
Merc.
Comment #6
mercmobily commentedHi,
Hummmm this is nastier than I thought.
Have a look here:
http://www.drigg.org/feed/all/All
The form _is_ there. However, it doesn't have any CSS, and the javascript is disabled.
I am 99.9% sure you can't define your CSS in an RSS feed. So, the only way to do this is through the EVB (external voting button), where you actually show the form just by inserting a bit of Javascript in there.
Can you please send me the EXACT url of a feed with JAvascript in it?
Some hints:
* Digg doesn't have voting forms in their feeds. REALLY bad sign.
* I don't actually think you can
Please let me know as soon as possible. This is nearing a "won't fix" I am afraid.
Bye,
Merc.
Comment #7
mercmobily commentedHi,
WatcherFR, are you still with us?
Please let me know. Drigg is under _very_ active development, and...
Merc.
Comment #8
mercmobily commentedHi,
Poster disappeared, missed his chance to see what it looked like.
Researched more, not a chance to do it for now.
Not even Digg does it.
Bye,
Merc.
Comment #9
PGiro commentedPoster still here but spending some time outside of cyberspace :)
Been trying to find where I saw something similar but couldn't either. Looking at feedburner feeds, I noticed they encode the links using HTML entities, see for example : http://feeds.feedburner.com/lavieimmo-news?format=xml
If you look closely at the end of each description is a 1x1 image embedded by Feedburner. I'm checking to see if I can embed the javascript button I created
Comment #10
PGiro commentedI confirm that it doesn't work in Netvibes : the javascript gets squeezed out. Oh well
Comment #11
mercmobily commentedHi,
Sorry, doing this is actually impossible :-(
Merc.
Comment #12
PGiro commentedHi again Merc, just for the sake of it, I have finally found an example of this. Check out the RSS feed at seomoz.org. This is what I get at the end of my feed when I view it in Netvibes:
Do you like this post? Yes NoAnd the Yes link goes to http://www.seomoz.org/thumbs/add/blog/4481/1/0 which looks like a vote to me :)
Comment #13
mercmobily commentedHi,
I spent 10 minutes trying to create an account, without which the link above won't work.
Please:
1) CHECK CAREFULLY that what you see there is _actually_ Javascript
IF and ONLY IF that is Javascript...
2) Send me a working login/password by email
I don't think it's technically possible. If it's just links, then it _cannot_ be done (not in an easy way that also looks good). That's why I am defaulting it to won't fix.
Bye,
Nerc.
Comment #14
PGiro commentedDoes it matter whether it's javascript or not ? All we need if for the link to be generated in the feed, doesn't need to be javascript.
The link is plain HTML in the Feed, look at the XML source of at http://feeds.feedburner.com/youmoz
The HTML is escaped
Do you like this post? <a href="http://www.seomoz.org/thumbs/add/blog/4477/1/0">Yes</a> <a href="http://www.seomoz.org/thumbs/add/blog/4477/0/0">No</a>
So yeah, you wouldn't be able to display current karma but we'd still be able to allow people to vote and interact with the site. That can get some hooked !
Comment #15
PGiro commentedFor future reference, problogger's RSS feed of the day features a voting button with radio buttons. See attached screen shot.
It seems like <content:encode> does the trick. I don't know how other feedreaders react to this sicne I only use netvibes. Can anyone check ?
Here is the RSS feed source:
Comment #16
PGiro commentedMoving back the issue to active since something IS possible
Comment #17
mercmobily commentedHi,
In that situation, OK. However, NO CSS is allowed. It's immensely hard to apply it to each story in the feed, and make it look even half decent.
Plus, RSS feeds are meant to be used to feed information, rather than providing a voting form.
I personally don't think this should be done. However, I will review patches.
Merc.
Comment #18
cedricfontaine commentedComment #19
cedricfontaine commentedMerc,
I didn't check in the code but is there any URL to go to vote for a specific post ?
I mean if we want to add a way to vote in RSS/XML I suggest that we add a link to click on to cast a vote. We can't use javascript in RSS and we also need to identify the user or offer log in/register option.
Thanks for your help
Comment #20
mercmobily commentedHi,
I think the poster's idea (which might make sense in our case) is to put the HTML *form* in the RSS feed. That *is* possible. It's not rendered amazingly well, but it's there. If the voting form is there, and a user who is NOT logged in votes, then he;s automatically redirected to the login/register page.
I think a possible solution would be to simply add an option like it happens for drigg_users:
---------------------
PHP code which will be execute to show the voting forms in the "commented on" tab:
return extra_voting_forms_show_form($node,'n',3);
----------------------
So, in drigg_ui (which is the part of Drigg that manages the RSS feeds) we could add an option where a user can add php code to each node, where the $node variable is set, and eval() that code (exactly as it happens now in drigg_users.module in order to keep Drigg agnostic to the voting widgets).
What NEEDS to be done, though, is check that the results are OK.
Does this make sense?
Merc.
Comment #21
cedricfontaine commentedYes but do you agree that we can't use extra_voting_forms_show_form or we have to do a special case for casting vote from rss (we can't use js)
Comment #22
mercmobily commentedHi,
One of the nice things about extra_voting_forms is that it doesn't need Javascript. Try and disable javascript in your browser: you will see that the voting forms will _totally_ work.
I am not sure that thi is enough to have something that works in an RSS. If it isn't, then it should probably be a won't fix.
Merc.
Comment #23
cedricfontaine commentedWe can't put any form in XML. It doesn't work well, it's not supported by Google Reader and many others RSS Readers.
I do agree with 14 : we should offer a simple link text : vote for this story : Yes / No with a link to cast the vote. We have to make sure this does not break vote and offer a way to add a link to vote (as in XSS injection already).
Comment #24
mercmobily commentedHi,
I agree with the link text! Are you able to add it?
Merc.
Comment #25
cedricfontaine commentedSo what need to be done is :
a page handler to go when a user clicks on vote for this story.
A form to display on this page and user has to click on submit to really cast his vote.
Are you okay ?
Comment #26
mercmobily commentedHi,
This is messier than expected. I hadn't thought of it.
Basically, there would be a lot of replication with existing code since we are basically saying "show the node, without the teaser but just the voting form". Then, why not linking straight to the node, that has the voting form? But wait! That's already there -- it's the link to the story itself!
This doesn't convince me _at all_.
I don't like this idea. If the form cannot safely go straight in the RSS, then it's a won't fix -- if you think otherwise, Cedric, feel free to reopen it.
Merc.