I'm using the Twitter module with FeedAPI.

It should post a message on twitter.com when the user adds a new node.

The Twitter module is correctly working: if I "manually" add a story, eg. using node/add/story, the message is correctly posted also on my twitter account.

Stories added using FeedAPI Node processor are NOT posted on twitter.

I don't know if it's a Twitter or FeedAPI issue, could anyone check if it's a bug?

Thanks.
Giovanni

Comments

aron novak’s picture

The problem is that at FeedAPI, when the item is created, it does not go through the node form.
The two modules are incompatible at the current status.

Antinoo’s picture

As far as I can understand, this means that the Twitter module will be incompatible not only with FeedAPI, but also with whichever module is not going through the node form when creating a new node.

I've just reported this into the Twitter module issue queue.

Anyway, thank your for your concern, Aron.

alex_b’s picture

Status: Active » Postponed

The problem is that twitter checks for the presence of $node->twitter and $node->twitter['post'] before issuing a post to twitter. Those two variables are only present if 'insert'/'update' come from a node form. In the case of FeedAPI node they don't.

You should be able to create a simple custom module that implements hook_nodeapi('prepare') and adds $node->twitter and $node->twitter['post'] to feed item nodes. Thus you can trick twitter module to fire when FeedAPI node creates a feed item node. I postpone this issue for now.

function twitter_nodeapi(&$node, $op, $a1) {
  module_load_include('inc', 'twitter');

  switch ($op) {
    case 'insert':
    case 'update':
      if (!empty($node->status) && !empty($node->twitter) && !empty($node->twitter['post'])) {
        $twitter_accounts = twitter_get_user_accounts($node->uid, TRUE);
        // ...
rlnorthcutt’s picture

Could this be done as an Action with a Rule?