28, May 2012

RSS to Twitter tweaks - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: RSS to Twitter tweaks
« previous next »
Pages: [1] Print
Instabuck - The easy way to sell digital products online

Author Topic: RSS to Twitter tweaks  (Read 1786 times)
Google dot what?
*
Posts: 2
16 credits
Members referred : 0


« on: Jul 30, 2009, 09:15:03 pm »

I implemented the RSS to Twitter app and it worked great.  Thank you.

Right now the tweet is displaying the title and shortened link.  I'd like to display the title and description with either of the above tagged with the link (so the actual link URL doesn't display but the title or description are linked to the full text).

If it's awkward to link the title or description instead of displaying the shortened link, I would prefer to display the entire original link rather than the shortened one.  How would I do that?

I appreciate the help.  I'm a PHP shoemaker trying to learn.

Thanks.
Google dot what?
*
Posts: 2
16 credits
Members referred : 0


« Reply #1 on: Aug 01, 2009, 03:21:24 pm »

Since there haven't been any takers, perhaps someone can tell me if my changes to the code as below are correct...

Code:
//Parse the feed
$messages = array();//Here we will store all the messages that we are going to post to twitter
foreach( $feed->channel->item as $item ){
$title = $item->title; // If you want to fetch the description instead use $item->description
$description = $item->description;
$url = $item->link;
//Have we already posted that?
if ( $url == file_get_contents($file) ) break;
//Now do the actual posting.

I added $description = $item->description; as above, and then $description . ' ' . as below:

Code:
//Now Calculate the twit message
$cnt = 140 - strlen($shortURL) - 1;
$messages [] = strlen($title) <= $cnt ? $title . ' ' . $description . ' ' . $shortURL : substr($title,0,$cnt-3).'... '.$shortURL;
$lastURL = empty($lastURL) ? $url : $lastURL;
}

Please help if I'm missing something...

Thanks.
« Last Edit: Aug 01, 2009, 03:26:07 pm by turfnet »
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #2 on: Aug 02, 2009, 08:58:06 pm »

That looks ok. As for the original links I am afraid that is something that you can't do as the original links would be too big to used in 140 characters. Anyway twitter uses nofollow to the links so there is no meaning doing that seowise.

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Chicken-run Manager
*
Posts: 9
54 credits
Members referred : 0


« Reply #3 on: Sep 09, 2009, 11:55:45 am »

When I tried this it would show the title and description but the problem is that it wouldn't create the short url so i'm not sure what is still missing or needed. Would be nice if it worked. Other thing I noticed is the log file is only recording the last url out of the feed which seems like it should be recording every feed it posted.
« Last Edit: Sep 09, 2009, 12:14:38 pm by raymond4000 »
Chicken-run Manager
*
Posts: 9
54 credits
Members referred : 0


« Reply #4 on: Sep 09, 2009, 08:35:55 pm »

Just noticed today that when I run this as a cron that it is reposting the same feeds over and over again for what ever reason... lol Doesn't look like the log file is working correctly. Anyone else have that issue?
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #5 on: Sep 16, 2009, 07:09:16 am »

Maybe the script has no rights to write to the file?

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=8991
Tags : rss Twitter php Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: RSS to Twitter tweaks
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 11:42:28 pm





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.