How about the other way around: Let your website have a Twitter identity and have Drupal's cron poll for new messages to the site (using the Twitter API).

Or would this be something that should better be done outside of Drupal (e.g. with a real cron and a shell script)?

Comments

bertboerland’s picture

maybe i dont understand what you mean, but importing twitter's into drupal would be trivial since you just can grab the rss and import that in the news aggregator?

cglusky’s picture

The below code was automagically generated by twitter's badge utility. You should be able to change "yourtwittername" in the code to your twitter name and stuff it in a block. This should work OK for site wide usage, but if you want each user to have there own, in say their profile page, there needs to be a hook to pull the users info and stuff it in a variable. I know it can be done and there is already a pending patch to do something similar I just don't have the time right now.


<div id="twitter_div">
<h2 class="twitter-title">Twitter Updates</h2>
<ul id="twitter_update_list"></ul></div>
<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
<script text="text/javascript" src="http://twitter.com/statuses/user_timeline/yourtwittername.json?callback=twitterCallback2&count=5"></script>

JulieLA’s picture

Wow - THANK YOU! That's exactly what I was looking for.

Blinkme’s picture

Totally amazing ..thank you soo much!!

Shai’s picture

Don't forget RSS. Every Twitter account has a built in feed. So using Aggregator module (for simple implementations) or Feed Api (for more complex ones) -- you can do a lot. This is just an alternative to cglusky's approach. That approach is great too.

abhir314’s picture

+1 :-)

cglusky’s picture

Yeah, I am using Twitter's Search API now to pull what I want through FeedAPI. The above code is just a very quick solution.

Here's a sample from Twitter's Search API that will return an Atom feed of all twetes with hashtag #drupal:

http://search.twitter.com/search.atom?q=%23drupal

Enjoy,
Coby

Shai’s picture

Here is some good stuff on creating a group Twitter account. Might be a tangent to what you are talking about, but it's cool stuff I thought you'd be interested in.

http://www.hilarymason.com/blog/web-dev/create-a-group-twitter-account/

Shai

cglusky’s picture

Thanks Shai. Not sure I would go to all the fuss since a unique hashtag provides enough grouping for me. If you need more I guess you could create the pseudo group account on twitter and then have anyone interested send the twete to that pseudo group account name. They could also append a hashtag or two and you get pseudo sub groups.

Then you could use the Twitter Search API to pull the results.

twete sent to twitter user... '@coolhipconference' with a hashtag of... '#yougetthepoint'

(would be cool if it returned something)

http://search.twitter.com/search.atom?q=to%3Acoolhipconference+%23youget...

ah well, enough off topic stuff for one day.

R,
C

emdalton’s picture

That works, but any subsequent edits on the page break the twitter listing, because the script tags get stripped out. I'm going to try to make an input filter for this.

emdalton’s picture

I mean, the suggestion in #2 works. I tried to edit my previous comment and couldn't -- got an error on save. Not sure what's up with that.

mkogel’s picture

I used the Twitter's html code generated from Twitter on a block which I created on the Drupal site.
1) it did not pull anything - Don't know how this works on your site.
2) it pulls only the users own tweeds not the followers/followees

The latter is what I wanted so I used the Twitter module. It works well now but there is a manula work involved, to add the other twitter accounts into the twitter accounts in order to view the friends' tweeds.

dhroople’s picture

It is showing the tweets but hoe to display user image to it
Solution needed?

Thanks

Erikpost’s picture

well shave my head and call me grandpa, Now I have to log on to twitter every time i visit my page....

killua99’s picture

Status: Active » Reviewed & tested by the community

Drupal 5 is not maintenance any more, If this issue occurs in any version for Drupal 6 or Drupal 7 reopen this issue.

killua99’s picture

Status: Reviewed & tested by the community » Closed (won't fix)

ops

jibran’s picture

#2 Thanks for the code