Using twitter naturally with weblinks

Summit - June 29, 2009 - 17:45
Project:Web Links
Version:6.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:won't fix
Description

Hi,
I am looking at the possibility to post a weblink to twitter and it seems that the natural way of doing this doesn't work with weblinks after further investigation.

I think it has to do with exactly the same as feedapi architecture: http://drupal.org/node/379748

Is it true that like feedapi, weblinks build nodes through node_object_prepare() and node_save(), rather than drupal_execute(), so the twitter "Post to twitter.com" code never gets fired.
Is this correct analyses?

Greetings, Martijn

#1

Summit - June 29, 2009 - 18:12

Add on may be using twitter, as described on http://drupal.org/node/379748

/**      
* Implementation of hook_nodeapi().
*/
function Custommodulename_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  switch ($op) {
    case 'insert':
      if ($node->type == 'weblinks') {
        module_load_include('inc', 'twitter');
        $twitter_accounts = drupal_map_assoc(array_keys(twitter_get_user_accounts($node->uid, TRUE)));
        $node->twitter['post'] = TRUE;
        $node->twitter['status'] = 'RT @!title';
        $node->twitter['account'] = array_pop(array_keys($twitter_accounts));
      }
      break;
  }

#2

NancyDru - July 1, 2009 - 20:17

To be more precise, we don't build the node at all -- the node module does it. I don't understand why the Twitter module can't intercept standard Drupal actions. I've posted in that issue for more information.

#3

Summit - July 3, 2009 - 09:54

Hi Nancy, made a specific bugreport about this: http://drupal.org/node/509184 Greetings, Martijn

#4

NancyDru - July 3, 2009 - 13:28

Thanks

#5

NancyDru - July 6, 2009 - 19:07
Status:active» postponed (maintainer needs more info)

#6

NancyDru - September 13, 2009 - 23:36
Status:postponed (maintainer needs more info)» won't fix

Please reopen this when that other issue gets resolved.

 
 

Drupal is a registered trademark of Dries Buytaert.