Upgraded to 2.2 this morning, and posted a new blog item. Twitter reported back:

New post: Global village or global panopticon? !tinyurl

Comments

eaton’s picture

Status: Active » Fixed

Now fixed, and a 2.3 release has been rolled. Thanks for your patience with this, the 2.1 release had some... funky in it. 2.2 was pushed out a bit too early, but now it all appears OK.

pilotbob’s picture

Version: 6.x-2.2 » 6.x-2.3

I see there is now a new token in the Twitter module setup !tinyurl. But, I need to use an action to get this to work when blogging using the xmlrpc API. However, the tokens shown for the action do not include tinyurl... I think because they are the standard action tokens.

Is there possibly a way to have the action use tiny URL???

Thanks
BOb

Antinoo’s picture

Title: Tinyurl token not replaced » Tinyurl and aliased path tokens for Actions
Category: bug » feature
Status: Fixed » Active

It would also be useful a kind of %node_url_alias to get the alias path of the url, instead of the ugly "node/$nid" path, as Bob some time ago also noticed on his blog.

Setting this issue as feature request and changing the title to reflect the content.

acrollet’s picture

Status: Active » Needs review
Issue tags: +twitter, +XML-RPC, +tinyurl
StatusFileSize
new1.41 KB

I wanted this too, so I went ahead and coded it up - works for me, just use %tinyurl. (documented in the help too) This patch is against 2.3, and includes the patch from this issue: http://drupal.org/node/375402

acrollet’s picture

Version: 6.x-2.3 » 6.x-2.6
StatusFileSize
new589 bytes

re-rolled against 2.6 and tested working - would be nice to get this in...

spiderman’s picture

StatusFileSize
new1.27 KB

Just giving this a bump, and I've re-rolled a complete patch against 2.6 based on #4 and #5 combined.

fnikola’s picture

I'm experiencing that the %title and %tinyurl variables are not available in the "Post a message to Twitter" action on the "after saving new content" event.

cwebster’s picture

Try this:

1. Add an action "Post a message to Twitter".
2. In the Message field, paste the following code.

print $node->title.' '.url('node/'. $node->nid, array('absolute' => TRUE));

That will print the node title and the tinyurl.

- OR -

...you could use the following code, which not only posts the title and the tinyurl, but also trims the title first and maintains the full tinyurl, so that you will avoid broken links if your title runs long.

$url = url('node/'. $node->nid, array('absolute' => TRUE));
if(strlen($node->title.' '.twitter_shorten_url($url)) <= 140){
  print $node->title.' '.twitter_shorten_url($url);
}else{
  $title = substr($node->title,0,136-strlen(twitter_shorten_url($url))).'...';
  print $title.' '.twitter_shorten_url($url);
}

Hope that helps!

summit’s picture

It is working great! Thanks.
greetings, Martijn

ajuliano’s picture

The patch in #6 works great for 2.6 (I haven't tested the other)!

Except for one thing: I couldn't apply the patch using Mac OS X's $ patch-command (http://drupal.org/node/60818).

I did a manual copy/paste instead. And the tinyurl for actions now works like a charm. Thanks!

claudiu.cristea’s picture

Version: 6.x-2.6 » 6.x-3.x-dev
StatusFileSize
new1.49 KB

Here's a patch against DRUPAL-6--3

dandaman’s picture

Status: Needs review » Reviewed & tested by the community

The patch on #11 works great on Twitter 6.x-3.0-beta2, although I don't think the line numbers currently match up perfectly. It's exactly what you need when posting to Twitter and works with the Shorten module as well, of course.

walkah’s picture

Status: Reviewed & tested by the community » Fixed

committed. nice patch! thank you :-)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Rob T’s picture

#8 worked well for me. I used it w/ Triggered rules.