Posted by kakajoe on September 8, 2009 at 6:14pm
Jump to:
| Project: | |
| Version: | 6.x-3.x-dev |
| Component: | Miscellaneous |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (won't fix) |
| Issue tags: | Facebook-style Statuses |
Issue Summary
hi..i already intregrated this module with FBSS, and my user can change their status automaticly to their twitter account, but how if my user want to change their status on my website from their twitter account ?? is it possible ??
thanks
Comments
#1
yyyuuuuhhhuuuu ???
#2
I think this is outside the scope of the Twitter module.
You should be able to write a custom module to perform this action.
#3
Hi, I'm the maintainer of the Facebook-style Statuses module, and I would like to see this happen. It's not out of scope: the changes required in the Twitter module are probably no more than one line.
Basically, there are four things that need to happen if this is going to work as beautifully as I would like.
1, 3, and 4 are good candidates for a new module or submodule, and I could then move some of the existing Twitter integration in FBSS out to that new module. #2 needs to be implemented in the Twitter module. It already exists in 2.x in the form of
hook_twitter_status_update(); unfortunately, that hook is not in the 3.x branch.#4
This addresses FBSS' side of #2, but of course it only works if hook_twitter_status_update exists (which, again, it does in 2.x but not 3.x). I haven't yet decided how to deal with #1 or #4, as they both involve a number of questions regarding the exact implementation.
<?php
//For now, this code assumes that it will be placed in the facebook_status module,
//but it will probably be split out into its own module because #3 requires a separate
//database table.
/**
* Implementation of hook_twitter_status_update().
*/
function facebook_status_twitter_status_update($tweet) {
if (!trim($tweet['text'])) {
return;
}
$account = db_fetch_object(db_query("SELECT uid FROM {twitter_user} WHERE screen_name = '%s'", $tweet['screen_name']));
//If a status is the same both locally and on Twitter, we disregard it if it
//was posted within the same week. Otherwise, we count it as a new (separate)
//status. Of course, this assumes cron at least once a week.
$result = db_fetch_object(db_query("SELECT COUNT(sid) count FROM {facebook_status}
WHERE status = '%s' AND uid = pid AND pid = %d AND created > %d",
$tweet['text'], $account->uid, time() - 60 * 60 * 24 * 7));
if ($result->count > 0) {
return;
}
$status = (object) array('status' => $tweet['text'], 'status_time' => $tweet['created_time'], 'uid' => $account->uid, 'pid' => $account->uid);
drupal_write_record('facebook_status', $object);
//Invokes hook_facebook_status_save($status_owner_object, &$status, $sid, $edit).
module_invoke_all('facebook_status_save', user_load(array('uid' => $account->uid)), $tweet['text'], $object->sid, FALSE);
//Appbar integration.
if (module_exists('appbar')) {
appbar_set_message(t('You imported a new status from Twitter.', array('!status' => theme('facebook_status_item', $object))), 'facebook_status-update-own', $user->uid);
}
}
?>
#5
anyone can make this happen?IceCreamYou been half-way to make this happen, it would be better if this could happen..
sorry can't help you :(
#6
Well, I can do this all the way for Twitter 2.x. The point of this issue is that the required hook in the Twitter module doesn't exist in 3.x, which is okay for now because there is no stable release of the 3.x branch, but I would prefer to support the latest version.
Specifically,
module_invoke_all('twitter_status_update', $status)would have to be added back tofunction twitter_status_saveon line 68 in twitter.inc.#7
any news about fbss - twitter3 integration?
#8
I also would like to use this integration.
Therefore i vote for the needed hook as stated by IceCreamYou. (please).
#9
subscribe
#10
Opened #1261704: Add a hook when Tweets are saved specifically to track the main thing the Twitter module needs to do to at least make this possible.
#11
I like the new issue, and will close this one. Thanks!