Just checking out this module. Couple little things.

In the modules page /admin/modules/list/

It should just be "Twitter Block" & not "Twitter Block module"

There are a few things that should be cleaned up when I ran it through the Coder module.

Also I think you mean #description rather than #help - http://api.drupal.org/api/drupal/developer--topics--forms_api_reference....

  $form['twitter_block_' . $delta]['lang'] = array(
    '#type'  => 'textfield',
    '#title' => 'Language',
    '#help'  => t('If you would like to limit the search by a language, '.
            'you can set it here. This should be the specific string expected by '.
            'twitter for your language. See the twitter advanced search page for '.
            'more information. (Hint: English is "en"). Leave blank if you don\'t '.
            'want to filter by language at all.'),
    '#size'  => 12,
    '#default_value' => $config['lang'],
  );

I also wasn't able to get the results displayed to the block based on my twitter username.

Comments

ZenDoodles’s picture

Title: Problems » Results based on my twitter username
Assigned: Unassigned » ZenDoodles

Thanks so much for the feedback Mike,
I really appreciate that you took the time to have a look.

1. Good catch. A fix for the name in the modules list will be in the next release.

2. Another good one. I did mean description. This will also be in the next release.

3. When I use your twitter username, "mgifford" on my test site I get your tweets in the block. If you're looking for tweets from the users you follow on twitter, you'll need a module with full integration and authentication like the twitter module. I do however hope to implement twitter lists (http://dev.twitter.com/doc/get/:user/lists/:id/statuses) soon, which may give you similar functionality without requiring authentication.

If however, you've configured the block to display tweets *from* your username, and you are not getting results, please post your what settings you've used. I may need to add a debug mode in the next release so I can help troubleshoot issues.

Thanks again!

mgifford’s picture

Thanks. I just opted to go with a jQuery route here - http://openconcept.ca/blog/mgifford/using-jquery-tweet-scripts-drupal

Seems to do what I need for now. I was using the username for http://twitter.com/#!/mgifford

Being able to suck down lists is also useful. Thanks for your quick response. I've edited the blog post.

safetypin’s picture

I'm not able to get any output from this module at all. I'm guessing there may be some conflict, but I'm not sure of how to investigate. I'm attaching a screenshot of my configuration. I first tried the beta release, and then the dev release in case you had made some update that fixed it, but I still get nothing.

safetypin’s picture

Looking at the log messages, I see this error:

Recieved an unexpected reply from Twitter. Perhaps just a fail whale? Our search url with query:
@http://search.twitter.com/search.json?rpp=5&q=from%3A%40coldplay

That URL doesn't look properly formatted. It shouldn't have an @, should it?

When I just hit this URL in my browser, I get redirected to search.twitter.com. If I enter the URL without the @ at the beginning, I get a JSON error that says I must enter a query. I'm attaching a series of screenshots.

safetypin’s picture

That last image doesn't have an appropriate filename. Here's the image of the twitter error without question marks, semi-colons, and ampersands.

safetypin’s picture

After looking at the API a little, and hitting the search a little, it looks like this URL works: http://search.twitter.com/search.json?q=from:coldplay&rpp=5

If I try to hit the url with HTML entities for the URL, I get the same "You must enter a query" error. Is there some unescaping that needs to happen (or not happen) before the url generated by the module?

ClaudeS-1’s picture

I'm also getting no output (not even an empty wrapper in the block's region).

I have the same settings as #3. Also, when I go to Admin > Configuration > Web Services > Twitter Blocks, the overlay shows only a "Save Blocks" button, nothing else.

Would be interesting to have some more debugging/error-logging, to see what's stopping it working on some sites but not others (e.g. your test site)

ZenDoodles’s picture

@idlewilder Hmm... It is likely the error message has been escaped - not the url in the query. I don't think it would work for anyone if there is errant escaping going on. I do get results when I use your settings (both @urbnchild and @coldplay). Some troubleshooting information would be really helpful. I'll see what I can do. A debug mode is definitely on my list.

@ClaudeS As you can see, the configuration page is not quite done yet. However, the block configuration at admin/structure/block can be used to configure the default block. Great idea about debug or logging. Maybe this weekend.

trentoncolley’s picture

I'm having the same issue as @idlewilder with nothing showing up for my username using the same configuration settings.

I dug this out of the Twitter API. I think this is what you want to parse for usernames (twitter handles)?
http://dev.twitter.com/doc/get/statuses/user_timeline

zoo33’s picture

Status: Active » Needs review
StatusFileSize
new544 bytes

I had the same problem, on one machine but not the other. So it turns out to be dependent on the server environment, and I tracked it down to the use of http_build_query(), which has some encoding problems in some scenarios. So Drupal has its own version, drupal_http_build_query(), and using that instead solves the problem!

trentoncolley’s picture

Status: Needs review » Reviewed & tested by the community

Awesome works for me as well! Thanks @zoo33.

safetypin’s picture

Yes, this change worked for me as well. Needed to clear the cache, of course.

ZenDoodles’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

Excellent @zoo33!

Thanks so much for finding this. I was perplexed! This patch will definitely be in the next release.

mikemckend’s picture

In looking into this problem for myself I found that the twitter search api is unreliable in certain situations. At least for those of us who would like to display tweets from a specific user, the best way is to use "http://api.twitter.com/1/statuses/user_timeline/username.format". The issue seems to be that twitter only indexes tweets through their search function for 6 days. For those of us who don't tweet very often, this means our tweets won't show up.

I propose using the api instead of the search for all queries from this module, but it would be nice to get it working for tweets from a specific user at the very least. I'll try to make the changes myself, but I'm going to need some help creating a patch or submitting a pull request, I've never done either.

ZenDoodles’s picture

Status: Patch (to be ported) » Needs work

Hmm... this is interesting. I'm not ignoring you mikemckend, I'm thinking. :)

Meanwhile, if you get it fixed before I have a chance to look at it http://drupal.org/patch/submit has patch submission guidelines, and http://drupal.org/node/707484 has instructions. Hope to have time to look at this over the weekend.

Thanks!

dddave’s picture

sub

BarisW’s picture

Thanks, this patch solves my bug as well!

jwinton’s picture

Subscribe

bonjourmr’s picture

Subscribe.
Any ETA on this fix?
Do you need any help?

ZenDoodles’s picture

Looks like we have a patch for this in #1264734: Use twitter RESFful API instead of twitter search for getTweetsFrom. Hoping to get it in the next release.

ZenDoodles’s picture

Status: Needs work » Closed (duplicate)