How to use Twitter Pull?

Events happening in the community are now at Drupal community events on www.drupal.org.
pkcho's picture

I've been searching for how to use the Twitter Pull module. I have gone to the project page and read about how to tweak the settings for my use, by doing the following...

<?php if (function_exists('twitter_pull_render')) { print twitter_pull_render('@openpublish', 'OpenPublish', 10); } ?>

I tweaked the settings in the openpublish_core.module, but for the life of me, I have no idea how to get a block to show up anywhere.

I went to Context and scanned line by line for something related related to Twitter as something that could be configured and came up with nothing.

If someone could help me with what I'm missing that would be greatly appreciated.

Thank you,
Joe

Comments

hi, just an (my) example

chrysonline's picture

hi,

just an (my) example :

--------------------- php -------------------------

go to page-front.tpl.php

insert the following php codes :

<?php
print $left;
?>

<?php
print twitter_pull_render ('@openpublish', t('OpenPublish official'), 3, 'op_homepage_tweets');
?>

<?php
print $over_content;
?>

<?php
print twitter_pull_render ('@openpublisher', t('OpenPublish last trend'), 1, 'op_homepage_tweets');
?>

<?php
print $right;
?>

--------------------------- CSS ------------
CSS : in components.css,

/* Tweets 1*/

div.tweets-pulled-listing {
padding: 8px 0px 0px 0px;
margin: -14px 0 0 0;
color: #000;
}

ul.tweets-pulled-listing {
margin: 0;
padding: 0;
}

div.tweets-pulled-listing a {
color: #000;

}

.tweets-pulled-listing li {
background: #FFF;
border: 1px solid #d9d9d9;
padding: 6px;
margin: 0 0 7px 0;
}

div.tweets-pulled-listing ul {
background: none;
border: none;
font-family:Verdana, Geneva, sans-serif;
font-size: .9em;
}

div.tweets-pulled-listing .tweet-author a {
font-weight:bold;
color: #808285;
}
div.tweets-pulled-listing .tweet-text a {
color: #808285;
text-decoration:underline;
}

div.tweets-pulled-listing .tweet-time a {
color: #780F2C;
font-style: italic;
font-family:Verdana, Geneva, sans-serif;
font-size: .9em;
}

block-twitter_pull-op_tweets div.tweets-pulled-listing {

margin: 0;
}

CSS?

gunwitch's picture

Thanks for posting your CSS here, Chrys.

Just a single question:
why you're editing components.css for this?

Shouldn't that styles be set in the twitter-pull-listing.css (which comes with the Twitter Pull module)?

Thank you very much for

pkcho's picture

Thank you very much for helping me with this.

I guess my unfamiliarity with php shows in this case, not knowing what to do when given code like...

<?php if (function_exists('twitter_pull_render')) { print twitter_pull_render('@openpublish', 'OpenPublish', 10); } ?>

you place it in a page.tpl.php file.

The thought of placing it in the page-front.tpl.php did cross my mind, but then I ruled it out because how would it know where to place the twitter block in relation to the other content there?

Which leads to my next question... how do I control the position of the tweets, now that it is in a region?

Thank you,
Joe

PS. By the way, chrysonline, your site looks great!

If you have php enabled in

resveld's picture

If you have php enabled in your input formats, you can create a block in the admin pages.
Change the following:

@openpublish to your twitter username @yourname
OpenPublish to what you want it to be
10 to the amount of tweets you want to show

-Ronald

That makes sense. I should've

pkcho's picture

That makes sense. I should've thought of that!

Documentation-wise, it would have been so helpful to give an example or two of how to implement this.

Thank you,
Joe

Blocks

freescholar's picture

"I have no idea how to get a block to show up anywhere."

Go to Administer > Site Building > Blocks
There you may choose to configure each block and choose where to display it.
Hope this is what you meant ... It works with your theme, depends on the regions in the .info file of your theme as to what regions are available to display blocks.

Handbook on Platform Cooperativism, a movement building platforms and tools owned by the people. http://bit.ly/hackitownit

Create a new block for that code

gunwitch's picture

Yes, as the Micky Metts said, use that php code (change twitter name) to paste into the newly created block.
Just don't forget to set its input format to "PHP code".

I am using the following code

macuhail's picture

I am using the following code in a custom php field in a view:

<?php
if (function_exists('twitter_pull_render')) { print twitter_pull_render(arg(7), '', 5 ); }
?>

It works well for the most part. However, it will not limit the number of posts pulled to 5. It pulls around 100.

Any idea why this is not working correctly?

I figured out the problem. I

macuhail's picture

I figured out the problem. I needed to set the items to display to "1"

OpenPublish

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: