The Story

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.

My twitter signature

My Twitter Signature

Basic Idea

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.

How this miracle works ?

First we need an image that is going to be our template in the zip I added this one.
Base Image

baseimage

Second the script looks for your latest tweet and print this image.

Image with the tweet.

Twitter signature final

Tell me more

-”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.

Make it dynamic

-”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.

The Code


<?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($im255255255);
$textcolor imagecolorallocate($im000);
//Custom line limit
$tw_text wordwrap($tw,55);
// Custom font.
$font './arial.ttf'// Twitter user name display 
imagefttext($im8011020$textcolor$font$name.":");
// Twitter message display
imagefttext($im8011534$textcolor$font$tw_text, array('linespacing'=>.8));
// Twitter date of message display
imagefttext($im7025560$textcolor$font$dt);
//--------------------------------------------------------------
// Create twittersignature.png
imagepng($im,"twittersignature.png"); 
// Free up some memory
imagedestroy($im); 

echo "Success your new image is done! :Dn";
//--------------------------------------------------------------
?>


Download The Script

Download Dynamic Twitter Image Version v0.1

Downloaded a total of 33 times

Download the Basic Image PSD

Download Twitter Signature Base Image PSD Version 1.0

Downloaded a total of 13 times

Info

Rating

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 4.5 out of 5)
Loading ... Loading ...

Tags

,

Related Posts

Most Popular Posts

Comments

Add comments

Autor

silvercrow

Leave a Reply


:alien: :angel: :angry: :blink: :blush: :cheerful: :cool: :cwy: :devil: :dizzy: :ermm: :face: :getlost: :biggrin: :happy: :heart: :kissing: :lol: :ninja: :pinch: :pouty: :sad: :shocked: :sick: :sideways: :silly: :sleeping: :smile: :tongue: :unsure: :w00t: :wassat: :whistle: :wink: :wub: