1
ibleedv20
Does everyone have to make a buck on twitter blocks
  • 2009/8/15 1:26

  • ibleedv20

  • Friend of XOOPS

  • Posts: 32

  • Since: 2009/1/9 1


First I must say I am not really experienced with php and making blocks but here goes anyways.I am putoff by the whole make a buck on Twitter trend.I am trying to create a w=125 x h=250 block that shows my community leaders latest Twitter posts.Just the lastest.I want to host the background image in my database.Is this so hard? I dont want to create a buisiness.Just show the top ten leaders in the community.I see blocks with ads but yuk to them.If I can get thre right php maybe I can do the css and figure out how to link the backgrond image.Or maybe I am missing a piece of the puzzle as to why noone wants to give this away.the php I am using is

$feedUrl = 'http://twitter.com/statuses/user_timeline/15268838.rss';
$yourTwitterUrl = 'http://www.twitter.com/ibleedv20';
$disableUtf8 = false;
// ********************************************************

require XOOPS_ROOT_PATH.'/class/snoopy.php';

$snoopyDog = new Snoopy();
$snoopyDog->fetch($feedUrl);
$xml = simplexml_load_string($snoopyDog->results);
if($xml !== false) {
$elements = array('title', 'description', 'pubDate', 'guid', 'link');
echo "<ul>";
foreach($xml->channel->item as $item) {
foreach($elements as $element) {
$$element = $disableUtf8 ? utf8_decode($item->$element) : $item->$element;
}
$date = formatTimestamp(strtotime($pubDate), 's');
echo "<li><a href='".$link."' target='_blank'>".$date.' - '.strip_tags($title)."</a></li>";
}
echo "</ul>";
echo "<br /><a href='".$yourTwitterUrl."'>Follow us on Twitter</a>";
}


2
tcnet
Re: Does everyone have to make a buck on twitter blocks
  • 2009/8/15 6:05

  • tcnet

  • Friend of XOOPS

  • Posts: 297

  • Since: 2006/5/12


I am not a very good coder but this seems to work on my test server. php5 only

$feedurl 'http://twitter.com/statuses/user_timeline/15268838.xml';
$yourtwitterurl 'http://www.twitter.com/ibleedv20';
$itemlimit 5;  //Limit number of items

$xml = new SimpleXMLElement($feedurlNULLTRUE);

if(
$xml !== '') {  
  
$itemnum 0;
  echo 
'<ul>';
  foreach(
$xml->status as $status) {
    
$statusdate $xml->status[$itemnum]->created_at;
    
$statustext $xml->status[$itemnum]->text;
    echo 
'<li>'.formatTimestamp(strtotime($statusdate), 's').' - '.strip_tags($statustext).'</li>';
    
$itemnum++;
    if ( 
$itemnum == $itemlimit ) {
        break;
    }
  }
echo 
'</ul><br /><a href="'.$yourtwitterurl.'">Follow us on Twitter</a>';
}


Enter into a custom block set to phpscript.

3
JulioNC
Re: Does everyone have to make a buck on twitter blocks
  • 2009/8/15 6:32

  • JulioNC

  • Quite a regular

  • Posts: 239

  • Since: 2004/10/8


Hi
Your code it works, maybe yo need to reduce lenght title, you may put it on DIV with Background image.

Another thing. I use twitterjs for custom block engine that is more fast

[1]http://code.google.com/p/twitterjs/

4
ibleedv20
Re: Does everyone have to make a buck on twitter blocks
  • 2009/8/15 14:32

  • ibleedv20

  • Friend of XOOPS

  • Posts: 32

  • Since: 2009/1/9 1


That code gives me a white page.I am using 2.3.3

5
tcnet
Re: Does everyone have to make a buck on twitter blocks
  • 2009/8/15 15:02

  • tcnet

  • Friend of XOOPS

  • Posts: 297

  • Since: 2006/5/12


That's odd. Works here on WAMP local, XOOPS 2.3.3 and php 5.2.

The custom block was set to php script?

6
ibleedv20
Re: Does everyone have to make a buck on twitter blocks
  • 2009/8/15 15:13

  • ibleedv20

  • Friend of XOOPS

  • Posts: 32

  • Since: 2009/1/9 1


Yes double checked and gives white page for me anywhere I put it including previewing it.Set to php script and double checked copy and paste.

PS.I appreciate these replies and you are helping a soul self educate.

7
hervet
Re: Does everyone have to make a buck on twitter blocks
  • 2009/8/20 8:59

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


May be the easiest :
http://twitter.com/goodies/widget_profile

8
optikool
Re: Does everyone have to make a buck on twitter blocks
  • 2009/9/30 0:51

  • optikool

  • Not too shy to talk

  • Posts: 154

  • Since: 2007/3/26


I believe twitter's feed is just another rss feed. You should be able to use any news feed module from the repository. It would be just a matter of styling it. I created a feed module a few months ago just to see what it would like to pull in my twitter feed that I never use... as well as CNN feeds and my wife's gallery feed so I could put my daughter's gallery onto my page. I'd say check out some of the news feed modules and custom style them.

By the way I don't quite understand your title... Are you saying people are wanting to charge you for creating a custom twitter module? If that's the case, they may be charging you because they value their time.

9
bjuti
Re: Does everyone have to make a buck on twitter blocks
  • 2012/4/27 14:19

  • bjuti

  • Just can't stay away

  • Posts: 871

  • Since: 2009/1/7 2


TCnet's code doesn't work for me.

Does anyone know how to limit Herve's code to show only eg. 5 feeds?

Tnx

10
Anonymous
Re: Does everyone have to make a buck on twitter blocks
  • 2012/4/27 16:18

  • Anonymous

  • Posts: 0

  • Since:


With 5 feeds you mean 5 tweets? It's under preferences, or do you mean something completely different?

Login

Who's Online

87 user(s) are online (68 user(s) are browsing Support Forums)


Members: 0


Guests: 87


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits