Comments

budda’s picture

Version: 6.x-1.0 » 6.x-1.x-dev

Yahoo Buzz is now open to all so would be good to see this feature added ASAP.

See http://buzz.yahoo.com/buttons

eyecon-1’s picture

BuzzUp would be a big plus. Subscribing

vkr11’s picture

+ 1 for Buzz

apb1991’s picture

Priority: Normal » Critical

Add buzz please :)

carusen’s picture

A vote for both.

webchick’s picture

Assigned: Unassigned » webchick
Priority: Critical » Normal

Looking at this.

webchick’s picture

Title: Support for mixx and buzz » Support Yahoo! Buzz

If someone cares about Mixx, let's deal with that in a separate ticket. There seems to be reasonable demand for this service, and not worth bogging down this issue with something unrelated.

webchick’s picture

Hm. This is a pain. :P

So the code to display the links looks like this:

  if (variable_get('service_links_show_SERVICE', 0)) {    $links['service_links_SERVICE'] = theme('service_links_build_link', t('SERVICE_NAME'), "URL_TO_SERVICE?u=$url&t=$title", t('Bookmark this post on SERVICE_NAME.'), 'images/SERVICE.png', $nodelink);
  }

Problem is, Yahoo! Buzz doesn't give one of those nice URL_TO_SERVICE URLs. Instead, it has JavaScript like so:

<script type="text/javascript"
	src="http://d.yimg.com/ds/badge2.js"
	badgetype="logo">
	$url			
</script>

badge2.js is of course one long line of obfuscated JS, deliberately written to make it difficult to discern what the "root" URL is. I ran it through http://www.prettyprinter.de/, which helped some, but it's still going to take some time and effort to reverse-engineer it properly.

An alternative is to make a special theme function just for Yahoo! Buzz that starts as basically a copy/paste of theme_service_links_build_link but outputting Yahoo!'s JS rather than the default stuff. It wouldn't be as powerful, since you can't do things like open it in a new window and such, and it introduces something unstandard from everything else in the module.

webchick’s picture

Status: Active » Needs review
StatusFileSize
new713 bytes
new1.57 KB

Ok, here's an initial stab at this using the same URL type construct as the rest around it.

I think this /should/ work, but I'm having a hard time getting the widget on its own, regardless of Drupal, to actually do anything. It alternates between "Hm. For some reason that's not in our system. We'll get to the bottom of it soon." and "There was an error processing your vote."

webchick’s picture

Let's try this...

webchick’s picture

Ok. I think I see. Yahoo! must have some security-checking code that prevents you from submitting a vote on a URL from anywhere but the URL. When I copy/paste that same widget above, it fails for me on localhost.

I guess I'm installing this module on webchick.net then. :P

It'd be really awesome if I'm having trouble getting the Yahoo! Buzz botton [sic] to work on my site. Why? was far less useless.

webchick’s picture

Status: Needs review » Needs work

Nate/quicksketch did some digging with Firebug and Tamper Data... turns out that JS is submitting a POST request, and must be checking server-side for the protocol, thus making it impossible to vote without JS. So... we're into special casing this. Bleh.

quicksketch’s picture

Status: Needs work » Needs review

Okay, here's some more information that I've been able to dig up:

- Buzz actually uses POST request when submitting articles, so a simple link is not possible as far as their API reveals
- Using the TamperData Firefox plugin, we can emulate the POST request by building a similar form

Here's code that almost makes this work, for this particular issue:

<form action="http://buzz.yahoo.com/vote/" method="POST">
  <input type="hidden" name="votetype" value="1" />
  <input type="hidden" name="loc" value="drupal.org" />
  <input type="hidden" name=".done" value="/article/pub/http%253A%252F%252Fdrupal.org%252Fnode%252F265391" />
  <input type="hidden" name="headline" value="Your mom" />
  <input type="hidden" name="guid" value="http://drupal.org/node/265391" />
  <input type="hidden" name="publisherurn" value="pub" />
  <input type="hidden" name="assettype" value="article" />
  <input type="hidden" name="from" value="pub" />
  <input type="submit" value="Submit" />
</form>

Or rendered out:










We potentially make this an image button, then put a text link next to it that submits the form (this is essentially what that Yahoo JS file does).

webchick’s picture

Trying the fancy widget that lets you pass in parameters...

webchick’s picture

Status: Needs review » Needs work

Ok, sounds like the way to fix this is add a new theme function specifically for Yahoo! Buzz, and base it off of what Fivestar does to show pretty stars instead of ugly radio buttons. Will probably need to duplicate a ton of logic from theme_service_links_build_link(). Meh. But, at least we could make this icon behave consistently with the others (for example, none of Yahoo! Buzz's widgets are "Text only" or "Icon with 'Yahoo! Buzz' next to it").

quicksketch’s picture

Status: Needs work » Needs review

Note: I actually submitted this issue as a Buzz article so that we can test our makeshift implementation against existing stories.

quicksketch’s picture

Sorry I keep crossposting :P

Here's a patch that should work fully. Unfortunately Buzz just has an unbelievably crappy API and everything has to be submitted via a POST request. This patch makes a few necessary changes to add a class to Buzz links and adds a buzz.js file that handles the submission of Buzz links.

webchick’s picture

This looks good. The only thing I'd recommend is naming the JS something more generic like "service_links.js" because chances are this isn't the first service that's going to need this kind of goofy workaround.

webchick’s picture

StatusFileSize
new7.5 KB

Here we go.

Anonymous’s picture

Version: 6.x-1.x-dev » 5.x-1.0

What about for version 5.x-1.0?

Anonymous’s picture

Version: 5.x-1.0 » 6.x-1.x-dev
xjessie007’s picture

I do not know how much useful this page is, but I found one page that talks about Yahoo Buzz related to Drupal, so I am posting it here:

http://drupal.org/files/issues/service_links-yahoo-buzz-265391-19.patch

They say a form is needed in the service_links module.

----
Your resource for finance and IT!
Central European Center for Finance and Management

Anonymous’s picture

That is the same patch listed in comment #19.. When I apply the patch to Drupal 5 it #2 (at line 329) and #3(at line 343).. I'm assuming this is because its new code since introduced for drupal 6. Is there any way I can get this working with version 5?

Fayna’s picture

Subscribing so I can try out the patch when I get home!

jwilson3’s picture

patch in #19 worked for me on 6.x-1.0, Thanks!

robloach’s picture

StatusFileSize
new3.29 KB
new3.29 KB
new670 bytes

I'd rather not use the JavaScript and just instead use the straight link tag. Here's the patch for both Drupal 5 and 6 branches, and the required images/buzz.png.

TheCrow’s picture

Assigned: webchick » Unassigned
Status: Needs review » Fixed

Rob patch added in 5.x and 6.x dev. version,

thank you alls for this interesting issue!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

tagorder’s picture

Status: Closed (fixed) » Needs review

Hi, I just got a note from the folks at Yahoo Buzz! noting that the correct way to implement the non-JS version of the Buzz button is as follows:

http://buzz.yahoo.com/buzz?publisherurn=PUBLISHER_URN&targetUrl=TARGET_U...

PUBLISHER_URN is for those who have a publisher relationship with Yahoo Buzz
TARGET_URL, HEADLINE and SUMMARY are self-explanatory

I'd recommend this generic change to the current service_links module, starting line 391:

  if (variable_get('service_links_show_buzz', 0)) {
    $links['service_links_buzz'] = theme('service_links_build_link', t('Buzz Up!'), "http://buzz.yahoo.com/buzz?targetUrl=$url&headline=$title&summary=$summary", t('Buzz up this post on Yahoo! Buzz.'), 'buzz.png', $nodelink);
  }

To be more complete (and this is what I have implemented on fastcompany.com, for now) perhaps the Yahoo Buzz! publisherurn could be added as an admin setting too, starting line 137:

  $form['what_links_to_show']['service_links_show_buzz'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show Buzz link'),
    '#return_value' => 1,
    '#default_value' => variable_get('service_links_show_buzz', 0),
  );
  $form['what_links_to_show']['service_links_buzz_publisherurn'] = array(
    '#type' => 'textfield',
    '#title' => t('Yahoo Buzz publisherurn (optional)'),
    '#default_value' => variable_get('service_links_buzz_publisherurn', ''),
    '#size' => 14,
  );

and then:

  if (variable_get('service_links_show_buzz', 0)) {
    $publisherurn = variable_get('service_links_buzz_publisherurn', '');
    $links['service_links_buzz'] = theme('service_links_build_link', t('Buzz Up!'), "http://buzz.yahoo.com/buzz?publisherurn=". $publisherurn. "&targetUrl=$url&headline=$title&summary=$summary", t('Buzz up this post on Yahoo! Buzz.'), 'buzz.png', $nodelink);
  }

Or is this 'overkill' ? Perhaps better addressed in the v2 release ? I'll create a patch if there's interest in this approach.

TheCrow’s picture

Hello kiwinyc, i guess this publisherurn must be a nickname... what about if someone doesn't have it? The param must be passed empty or is better leave it?

For 1.x branch it can be added soon, in 2.x at this point i'm thinking to provide some more hook for expand the tags

Thank you! :))

robloach’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Priority: Normal » Critical
StatusFileSize
new920 bytes

Here it is for the 6.x-2.x-dev version. This doesn't include publisherrun because I think we should add service-specific settings in the hook itself.... Maybe something like:

  $links['buzz'] = array(
    'name' => 'Buzz',
    'link' => 'http://buzz.yahoo.com/submit/?submitUrl=<encoded-url>&submitHeadline=<encoded-title>&submitSummary=<summary>&publisher-run=<buzz-publisherrun>',
    'description' => t('Buzz up this post on Yahoo! Buzz.'),
    'icon' => 'buzz.png',
    'settings' => array('general_services_buzz_settings'), // Array of hook callbacks for service settings?
    'preprocess' => array('general_services_buzz_preprocess'), // Array of preprocessing hooks?
  );

function general_services_buzz_settings() {
  $form['general_services_buzz_publisherrun'] = array(
    '#type' => 'textfield',
    '#title' => t('Publisher Run'),
    '#default_value' => variable_get('general_services_buzz_publisherrun', ''),
  );
  return $form;
}

function general_services_buzz_preprocess() {
  return array(
    '<buzz-publisherrun>' => variable_get('general_services_buzz_publisherrun', ''),
  );
}

Out of scope for this issue though. We should open a new issue for service-specific settings and then stick publisherrun in there. Thanks for noticing that, Jason!

robloach’s picture

StatusFileSize
new919 bytes

Whoops, it's targetUrl.

robloach’s picture

StatusFileSize
new835 bytes

It's already in there, but it's broken. This patch fixes it.

robloach’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.