Behaviour when no result (technorati)

bjacob - July 30, 2008 - 10:55
Project:Blog reactions
Version:5.x-1.3
Component:Code
Category:bug report
Priority:normal
Assigned:sanduhrs
Status:closed
Description

Say your module is looking up a url like http://www.domain.de on technorati. The service can't find a blog reaction (no result). Now a new line is added to the database including all columns. The title has as value "No reactions". When I'm displaying the node I'm getting the following output (I've changed the order of the parts in theme_blog_reactions_item() a little bit):

01.Januar.1970 - 02:01 No reactions

"No reactions" is linked to http://technorati.com/search/http%3A%2F%2Fwww.domain.de?noresults.

I thought the following lines prevent us from inserting empty results.

  if ($xml->channel->item->title == 'No results' && strpos($xml->channel->item->link, 'technorati.com')) {
    unset($data);
  }

What do you think is best? Preventing the insert of ab "no result line" into the database or formatting the output in a propper way?

Thx, Bjoern

#1

sanduhrs - July 30, 2008 - 11:09
Assigned to:Anonymous» sanduhrs

I can't reproduce the behaviour.
Just as you thought, the code you posted should prevent this, and it does it on my system!
What sysstem is your setup running on?
Lin/Win
Mysql/PHP/Apache versions?

#2

bjacob - July 30, 2008 - 11:47

Mmh, strange. I'm on Lin, MySQL 4.1.22, PHP 5.2.5, Apache 2.x. But I think this is not the problem. I had another look into your source code. Within the function blog_reactions_fetch_technorati() I've added two lines to output the values of $xml->channel->item->title and $xml->channel->item->link. Somehow the value for $xml->channel->item->link is "No reactions". Therefore I've changed the condition:

  if (($xml->channel->item->title == 'No results' || $xml->channel->item->title == 'No reactions') && strpos($xml->channel->item->link, 'technorati.com')) {
    unset($data);
  }

Now it's working. I went to technorati and did the search manually and I got "No reactions" as well. So I think we have to change the if statement.

#3

sanduhrs - July 30, 2008 - 11:59

Alright, it seems technorati has two different "nothing found" pages [1] [2], depending on if you provide a valid TLD or not.
So I'll change the code, as you suggest.
Thanks.

[1] http://technorati.com/search/http%3A%2F%2Fsomedomain/%2F?noresults
[2] http://technorati.com/search/http%3A%2F%2Fsomedomain.org/%2F?noresults

#4

sanduhrs - July 30, 2008 - 12:11
Status:active» fixed

Commited to 5,6,HEAD.
Thanks.

#5

Anonymous (not verified) - August 13, 2008 - 12:14
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.