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

CommentFileSizeAuthor
#15 Capture07-08-2008-09.22.58.jpg109.24 KBPGiro

Comments

mercmobily’s picture

Hi,

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.

PGiro’s picture

Well, 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

mercmobily’s picture

Hi,

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.

PGiro’s picture

Absolutly !

mercmobily’s picture

Assigned: Unassigned » mercmobily

Hi,

OK assigning this to myself.

Merc.

mercmobily’s picture

Hi,

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.

mercmobily’s picture

Hi,

WatcherFR, are you still with us?
Please let me know. Drigg is under _very_ active development, and...

Merc.

mercmobily’s picture

Status: Active » Closed (won't fix)

Hi,

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.

PGiro’s picture

Poster 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

PGiro’s picture

I confirm that it doesn't work in Netvibes : the javascript gets squeezed out. Oh well

mercmobily’s picture

Hi,

Sorry, doing this is actually impossible :-(

Merc.

PGiro’s picture

Status: Closed (won't fix) » Active

Hi 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 No
And the Yes link goes to http://www.seomoz.org/thumbs/add/blog/4481/1/0 which looks like a vote to me :)

mercmobily’s picture

Status: Active » Closed (won't fix)

Hi,

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.

PGiro’s picture

Does 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 !

PGiro’s picture

StatusFileSize
new109.24 KB

For 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:

<item>

		<title>Do you Run RSS Ads on Your Main Blog? [POLL]</title>
		<link>http://feedproxy.google.com/~r/ProbloggerHelpingBloggersEarnMoney/~3/GF39YD0LTIg/</link>
		<comments>http://www.problogger.net/archives/2008/08/07/do-you-run-rss-ads-on-your-main-blog-poll/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 20:50:59 +0000</pubDate>
		<dc:creator>Darren Rowse</dc:creator>
		
		<category><![CDATA[Reader Questions]]></category>

		<guid isPermaLink="false">http://www.problogger.net/archives/2008/08/07/do-you-run-rss-ads-on-your-main-blog-poll/</guid>
		<description><![CDATA[
It&#8217;s time for a new poll here on Problogger - this time the question is:


Do you Run RSS Ads on Your Main Blog?


RSS advertising has been around for a couple of years now and I see quite a few RSS ads appearing in my own RSS reading - but I&#8217;d be interested to know just [...]]]></description>
			<content:encoded><![CDATA[<p>
It&#8217;s time for a new poll here on Problogger - this time the question is:
</p>
<p>
<strong>Do you Run RSS Ads on Your Main Blog?</strong>
</p>
<p>
RSS advertising has been around for a couple of years now and I see quite a few RSS ads appearing in my own RSS reading - but I&#8217;d be interested to know just how far it extends into the blogosphere - so lets see shall we?
</p>
<div>
<div>
<div>
	<div class='democracy'>
		<strong class="poll-question">Do You Run RSS Ads on Your Main Blog?</strong>
		<div class='dem-results'>
		<form action='http://www.problogger.net/wp-content/plugins/democracy/democracy.php' onsubmit='return dem_Vote(this)'>
		<ul>
			<li>
					<input type='radio' id='dem-choice-343' value='343' name='dem_poll_37' />
					<label for='dem-choice-343'>Yes</label>
			</li>
			<li>
					<input type='radio' id='dem-choice-344' value='344' name='dem_poll_37' />
					<label for='dem-choice-344'>No</label>
			</li>
		</ul>
			<input type='hidden' name='dem_poll_id' value='37' />
			<input type='hidden' name='dem_action' value='vote' />
			<input type='submit' class='dem-vote-button' value='Vote' />
			<a href='/feed?dem_action=view&amp;dem_poll_id=37' onclick='return dem_getVotes("http://www.problogger.net/wp-content/plugins/democracy/democracy.php?dem_action=view&amp;dem_poll_id=37", this)' rel='nofollow' class='dem-vote-link'>View Results</a>
		</form>
		</div>
	</div></div>
</div>
</div>
<p><br clear="left"/></p>
<p>Looking forward to seeing the results of this poll.</p>
<p class="akst_link"><a href="http://www.problogger.net/?p=6238&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_6238" class="akst_share_link" rel="nofollow">Share This</a>
</p><div class="feedflare">
<a href="http://feedproxy.google.com/~f/ProbloggerHelpingBloggersEarnMoney?a=Heplf8tD"><img src="http://feedproxy.google.com/~f/ProbloggerHelpingBloggersEarnMoney?i=Heplf8tD" border="0"></img></a> <a href="http://feedproxy.google.com/~f/ProbloggerHelpingBloggersEarnMoney?a=w6xgkSnd"><img src="http://feedproxy.google.com/~f/ProbloggerHelpingBloggersEarnMoney?i=w6xgkSnd" border="0"></img></a> <a href="http://feedproxy.google.com/~f/ProbloggerHelpingBloggersEarnMoney?a=1QEGMM4e"><img src="http://feedproxy.google.com/~f/ProbloggerHelpingBloggersEarnMoney?d=138" border="0"></img></a> <a href="http://feedproxy.google.com/~f/ProbloggerHelpingBloggersEarnMoney?a=acsmELED"><img src="http://feedproxy.google.com/~f/ProbloggerHelpingBloggersEarnMoney?i=acsmELED" border="0"></img></a>
</div><img src="http://feedproxy.google.com/~r/ProbloggerHelpingBloggersEarnMoney/~4/GF39YD0LTIg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.problogger.net/archives/2008/08/07/do-you-run-rss-ads-on-your-main-blog-poll/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.problogger.net/archives/2008/08/07/do-you-run-rss-ads-on-your-main-blog-poll/</feedburner:origLink></item>
PGiro’s picture

Status: Closed (won't fix) » Active

Moving back the issue to active since something IS possible

mercmobily’s picture

Hi,

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.

cedricfontaine’s picture

Assigned: mercmobily » cedricfontaine
cedricfontaine’s picture

Merc,

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

mercmobily’s picture

Hi,

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.

cedricfontaine’s picture

Yes 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)

mercmobily’s picture

Hi,

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.

cedricfontaine’s picture

We 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).

mercmobily’s picture

Hi,

I agree with the link text! Are you able to add it?

Merc.

cedricfontaine’s picture

So 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 ?

mercmobily’s picture

Status: Active » Closed (won't fix)

Hi,

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.