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

kakajoe’s picture

yyyuuuuhhhuuuu ???

abraham’s picture

Status: Active » Closed (won't fix)

I think this is outside the scope of the Twitter module.

You should be able to write a custom module to perform this action.

icecreamyou’s picture

Title: twitter integration with Facebook style status (microblog) » Integration with Facebook-style Statuses (Microblog)
Status: Closed (won't fix) » Active
Issue tags: +Facebook-style Statuses

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. There should be a setting somewhere to turn on or off importing statuses into FBSS.
  2. There needs to be a hook called when Twitter saves a status so FBSS can listen and record the update.
  3. The relationship between the Twitter update and the FBSS update needs to be stored somewhere so we can later get data about it if we need to.
  4. There needs to be some indication that the status came from Twitter, i.e. a relationship in Views to expose the Twitter module's fields, plus probably something equivalent to an implementation of hook_facebook_status_render().

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.

icecreamyou’s picture

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.

//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);
  }
}
kakajoe’s picture

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 :(

icecreamyou’s picture

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 to function twitter_status_save on line 68 in twitter.inc.

sashainparis’s picture

any news about fbss - twitter3 integration?

Michsk’s picture

I also would like to use this integration.

Therefore i vote for the needed hook as stated by IceCreamYou. (please).

pribeh’s picture

subscribe

icecreamyou’s picture

Title: Integration with Facebook-style Statuses (Microblog) » Import tweets from Twitter to Facebook-style Statuses

Opened #1261704: Add a hook when Tweets are saved at hook_twitter_status_save() specifically to track the main thing the Twitter module needs to do to at least make this possible.

michaek’s picture

Status: Active » Closed (won't fix)

I like the new issue, and will close this one. Thanks!