Is this possible to get tweets on node titles. if so then how.

Thanks

Comments

amedjones’s picture

yup, you need to use the arg (1) which will retrieve the node id and pass it to node_load() which will retrieve the node object. From there you can extract the title

example

$node = node_load(array('nid' => $nid));
$title ->node->title;

hanno’s picture

Category: task » support
Priority: Critical » Normal
Status: Active » Closed (fixed)

closed as a solution is provided.

dcine’s picture

Could you explain with an example? please.
I know it's been a long time but ...

hanno’s picture

something like this?

<?php 
$node = node_load(array('nid' => $nid));
$title = $node->title;
if (function_exists('twitter_pull_render')) { print twitter_pull_render($title, t('Tweets about ').$title, 10); } 
?>
dcine’s picture

Ok, thank's. Perfect!

dcine’s picture

One more thing, If I want to filter the twets by language, What i have to do? (please!)

hanno’s picture

For language aware searches, you can add the parameter 'lang:es' to the twittersearch:

$node = node_load(array('nid' => $nid));
$title = $node->title;
if (function_exists('twitter_pull_render')) { print twitter_pull_render($title . ' lang:es', t('Tweets about ').$title, 10); }
Robin Millette’s picture