Hey si tu idioma es el español te invito a mis sitio totalmente en español:
http://www.silvercrow.org/es
I been using twitter for some days now and I got a little addicted to tweet. But you know twitter is one of this things that no one reads or at least no one wants to admit that reads.
So there must be a way for you to force everyone to read your tweets. That’s why they invented the twitter signatures there are a lot of sites that do this for you. Its easy you give your user name and they give you the link to an image that you can put in the signature of your favorite forum.
But lets be honest no one wants to spread someone else site and they intentionally add their url to the image also there are a few designs that everyone use.
That’s why I enter into the web in a quest for the holly script. “The perfect twitter signature script”. I found one but didn’t work with my host. Later I found many ways to collect the info from twitter so I decided to make one for myself and this is the result.
Well its simple I found a nice library that does all the hard work of retrieving messages from twitter : twitter for php 1.0 by David Grudl with this and with a small knowledge of image creating with php I made my twitter signature.
Continue reading to learn how and download the code.
First we need an image that is going to be our template in the zip I added this one.
Base Image
Second the script looks for your latest tweet and print this image.
Image with the tweet.
-”Omg that was way too sexy I want this what do I need ?”
You need a host with php5 with cURL extension.
If you are hosted in dreamhost this works like a charm, im on dreamhost.
-”OK I have all that what else do i need?”
You need to download the zip that you can grab at the end of this article and follow this steps
1)
edit sc-twittsig.php
and put your username and password
2)
upload everything to your ftp
3)
with your favorite browser point to the location of sc-twittsig.php in your website
example:
http://www.silvercrow.org/sc-twittsig/sc-twittersig.php
if everything was ok you should read this:
———————————————–
Starting the script
Calling twitter and asking for the info..
Creating your image…
Success your new image is done! :D
———————————————–
then browse to the same path and look for this file: twittersignature.png
example:
http://www.silvercrow.org/sc-twittsig/twittersignature.png
4) Enjoy go edit my image and make your own signature you can even use another font and colors.
-”Wait a minute this isn’t dynamic I need to browse to sc-twittsig.php everytime I want the image to change to the latest tweet!”
Ok relax this is true you need to execute the code in order to change the image but there is a solution you can set a cron job to do this for you.
here is an example of mine remember im on dreamhost if you are hosted somewhere else contact your hosting provider.
30 * * * * wget -q --delete-after http://silvercrow.org/sc-twittsig/sc-twittsig.php
That execute my twittsig code every hour at the minute 30.
<?php
//--------------------------------------------------------------
/*
Description: This script generates an image of your latest tweet
Author: silvercrow
Author URI: http://www.silvercrow.org
*/
//--------------------------------------------------------------
//Generating the code
header('Content-type: text/plain');
echo "Starting the scriptn";
//Calling the simple twitter function
require_once 'twitter.class.php';
//--------------------------------------------------------------
//
// ### Twitter user,password ###
$twitter = new Twitter('username', 'password');
// withFriends TRUE if you want to display friends messages
$withFriends = FALSE;
//--------------------------------------------------------------
echo "Calling twitter and asking for the info..n";
// Collecting some info
$channel = $twitter->load($withFriends);
// The date format can be changed
$dt=date("F j, Y, g:i a", strtotime($channel->status->created_at));
$name=$channel->status->user->name;
$tw=$channel->status->text;
//--------------------------------------------------------------
echo "Creating your image... n";
$im = imageCreateFromPng("baseimage.png");
// backgound and text color
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 0);
//Custom line limit
$tw_text = wordwrap($tw,55);
// Custom font.
$font = './arial.ttf';
// Twitter user name display
imagefttext($im, 8, 0, 110, 20, $textcolor, $font, $name.":");
// Twitter message display
imagefttext($im, 8, 0, 115, 34, $textcolor, $font, $tw_text, array('linespacing'=>.8));
// Twitter date of message display
imagefttext($im, 7, 0, 255, 60, $textcolor, $font, $dt);
//--------------------------------------------------------------
// Create twittersignature.png
imagepng($im,"twittersignature.png");
// Free up some memory
imagedestroy($im);
echo "Success your new image is done! :Dn";
//--------------------------------------------------------------
?>
Downloaded a total of 33 times
Downloaded a total of 13 times
Recent Blog Comments