PDA

View Full Version : ARGH!! GD!!



Jme
24-10-2008, 12:31 AM
Hey.

I've been working on a project similar to twitsig.com, where the user can enter their twitter username and generate an image with their latest tweet and use it as a forum signature or something along those lines.

Link:
http://www.jamiecassidy.net/tweetbox/?user=JamieCassidy

I've run into a few problems :(

1. The user variable HAS to be case sensitive, does anyone know why this is? :(
2. The avatar image on the image has a wierd colouring, anyone know how to fix it?

If anyone can help, it would be awesome.

Thanks,
Jamie.

EDIT: Fixed the avatar colouring by changing the content type to image/png but the variable problem is still an issue.

Excellent2
24-10-2008, 12:37 AM
You really need to tell me how to do that? :P

Jme
24-10-2008, 12:47 AM
It's just simple gd, but it's still buggy and im trying to sort it anyone got any ideas? :(

Source
24-10-2008, 12:50 AM
If your gonna put this live I've got a domain I never used, which was going to be for this purpose...

twitteroo.co.uk

I didn't realise at the time alot of other services used this domain name. But hey it you want it ask for it.

I really don't like the design of the signiture at the moment, its not really that much like twitter...

Jme
24-10-2008, 12:53 AM
Well that would be awesome, how much would you want for the domain?
Well, i guess it doesn't but twitsig.com is currently the most used one I belive and it doesn't really look like twitter except for the logo in the background.

Excellent2
24-10-2008, 12:57 AM
I meant how did you grab your tweet? I've built a little status updater but having trouble grabbing the tweets :)

Jme
24-10-2008, 12:59 AM
I didn't use any API's I jsut use the file_get_contents(); function and explode(); function to get the required data. :P

Source
24-10-2008, 01:00 AM
You can have the account if you want, got a year or 2 left I believe, im not gonna use it and at least I know your on eof the people on the forum that will probably get something out of it.

P.S I got bored;

http://www.tehupload.com/uploads/app-166084318227191622.png

Excellent2
24-10-2008, 01:01 AM
What url did you use to get the tweets?

Jme
24-10-2008, 01:02 AM
You can have the account if you want, got a year or 2 left I believe, im not gonna use it and at least I know your on eof the people on the forum that will probably get something out of it.

P.S I got bored;

http://www.tehupload.com/uploads/app-166084318227191622.png

haha, that is so much better than my design :P I love it.

@Excellent2
I just used twitter.com/username

Source
24-10-2008, 01:10 AM
Excellent, this isnt the way I used todo it, can't remember - but works!



<?php

$twitterUser = 'ajaxsm';
$twitterRSS = file_get_contents( "http://twitter.com/statuses/user_timeline/{$twitterUser}.rss" );

$twitterXML = new simpleXMLElement( $twitterRSS );

//echo username
echo $twitterXML->channel[0]->title . "<br>";

//echo url to user
echo $twitterXML->channel[0]->link . "<br>";

//latest status update
echo $twitterXML->channel[0]->item[0]->description . "<br>";

//2nd latest status update
echo $twitterXML->channel[0]->item[1]->description;

?>



remembered the other way! I am been stupid :P... writing now for you.

Excellent2
24-10-2008, 01:14 AM
Excellent, this isnt the way I used todo it, can't remember - but works!



<?php

$twitterUser = 'ajaxsm';
$twitterRSS = file_get_contents( "http://twitter.com/statuses/user_timeline/{$twitterUser}.rss" );

$twitterXML = new simpleXMLElement( $twitterRSS );

//echo username
echo $twitterXML->channel[0]->title . "<br>";

//echo url to user
echo $twitterXML->channel[0]->link . "<br>";

//latest status update
echo $twitterXML->channel[0]->item[0]->description . "<br>";

//2nd latest status update
echo $twitterXML->channel[0]->item[1]->description;

?>

remembered the other way! I am been stupid :P... writing now for you.Ty dude :)

Source
24-10-2008, 01:18 AM
Heres a better way of doing it, ignor the poop coding, sorry :P



<?php

$twitterUser = 'ajaxsm';
$twitterRSS = file_get_contents( "http://twitter.com/statuses/user_timeline/{$twitterUser}.xml" );
$twitterXML = new SimpleXMLElement( $twitterRSS );

//status
echo $twitterXML->status[0]->text . "<br>";

//lolwut when?
echo $twitterXML->status[0]->created_at . "<br>";

//id of post
echo $twitterXML->status[0]->id . "<br>";

//next load of update (status starts at 0 and goes up)

//status
echo $twitterXML->status[1]->text . "<br>";

//lolwut when?
echo $twitterXML->status[1]->created_at . "<br>";

//id of post
echo $twitterXML->status[1]->id . "<br>";


//Get user image

$image = $twitterXML->status[0]->user[0]->profile_image_url;

echo "<img src=\"{$image}\" />";

?>

Jme
24-10-2008, 02:06 AM
Updated the base image
http://www.jamiecassidy.net/tweetbox/?user=JamieCassidy
Still got the problem with the variable :(

Source
24-10-2008, 02:35 PM
post the code ? Or re-write it using the code I orignally posted for excellent.

Earthquake
24-10-2008, 02:39 PM
Thats very good, although I don't understand? Do we create a new user login, and update our own status for signatures, or is this just a personal project for yourself? In all, I think its awsome, good on you and keep up the great work!

Excellent2
24-10-2008, 02:41 PM
Thats very good, although I don't understand? Do we create a new user login, and update our own status for signatures, or is this just a personal project for yourself? In all, I think its awsome, good on you and keep up the great work!No, you change your user to ?user=USERNAME and it'll show your signature.

And thanks Source, +REP :)

Source
24-10-2008, 03:45 PM
I have started to work on a few ideas, that will never go public - im just throwing them around to see what people think....

http://uploadpicz.com/images/LSZ7VDR.jpg

I will be coding that up in GD within the hour or so, but I am really bad with GD so it may never actually exist ^_^. If I do get it working I'll post it up for people to use, I will also make a basic system to cache it in a mysql database (no image caching caus I dunno how), but the info will be cached in mysql to stop the wait of twitter.

edit // I may do temp image chaching as I just thought it through... im thick at time (ok most of the time).

Jme
24-10-2008, 05:20 PM
I have started to work on a few ideas, that will never go public - im just throwing them around to see what people think....

http://uploadpicz.com/images/LSZ7VDR.jpg

I will be coding that up in GD within the hour or so, but I am really bad with GD so it may never actually exist ^_^. If I do get it working I'll post it up for people to use, I will also make a basic system to cache it in a mysql database (no image caching caus I dunno how), but the info will be cached in mysql to stop the wait of twitter.

edit // I may do temp image chaching as I just thought it through... im thick at time (ok most of the time).

That looks awesome man but people may not like the restricted number of characters shown in the speach bubble? Can I ask, where did you get the funky looking bird? hahaha

Source
24-10-2008, 05:28 PM
The bird I have around on my pc, but its from a wallpaper - I think I originally found it on www.pixelgirlpresents.com

Anyway, JME post the file_get_contents and user variable part of the code so we can take a look.

Excellent2
24-10-2008, 06:27 PM
Quick tip for you jme, use source's code but use this instead of the sample which he used as ajaxsm or something. It works for me and it's not case sensitive.

$twitterUser = $_GET['user'];

Jme
24-10-2008, 06:47 PM
Quick tip for you jme, use source's code but use this instead of the sample which he used as ajaxsm or something. It works for me and it's not case sensitive.

$twitterUser = $_GET['user'];

I'm not that stupid ahahaha.
http://supersecretmatt.pastebin.com/d5e5e7e9a
that's my script there.
It's in need of a good cleaning up ahahaa, think i'm just gonna scrap the idea now.

RichardKnox
24-10-2008, 07:18 PM
No point doing it that way Jme when Matt has shown you the relatively easy way using SimpleXML.

Source
24-10-2008, 08:16 PM
We ended up putting our heads together...

http://91.121.5.147/tweetbox/status/twitter/jamiecassidy
http://91.121.5.147/tweetbox/status/twitter/ajaxsm
http://91.121.5.147/tweetbox/status/twitter/dentafrice
http://91.121.5.147/tweetbox/status/twitter/awfy

You get the idea, if you get an error its because we can only request 100 times an hour and it doesn't cache yet... will do soon.

Johno
24-10-2008, 11:01 PM
I have started to work on a few ideas, that will never go public - im just throwing them around to see what people think....

http://uploadpicz.com/images/LSZ7VDR.jpg

I will be coding that up in GD within the hour or so, but I am really bad with GD so it may never actually exist ^_^. If I do get it working I'll post it up for people to use, I will also make a basic system to cache it in a mysql database (no image caching caus I dunno how), but the info will be cached in mysql to stop the wait of twitter.

edit // I may do temp image chaching as I just thought it through... im thick at time (ok most of the time).

If we can use the one in that post, I will so totally use! :)

Dentafrice
25-10-2008, 02:48 PM
Been working on it and cleaning up the code, integrated Pownce into it as well.

Pownce:

http://fuzionphp.com/status/pownce/redguy/dentafrice.png

Twitter:

http://fuzionphp.com/status/twitter/default/dentafrice.png


Hopefully Matt can get the Slim one done :P A LOT better then twitsig I might add..

Dentafrice
25-10-2008, 03:13 PM
Just finished the Rejaw version :P

http://fuzionphp.com/status/rejaw/clown/youmeo.png

Moh
25-10-2008, 04:11 PM
http://www.habbcrazy.net/jack/myspace.php?user=tom

Dentafrice
25-10-2008, 04:14 PM
http://www.habbcrazy.net/jack/myspace.php?user=tom
go away.

this is our project.

Moh
25-10-2008, 04:15 PM
go away.

this is our project.
haha, ill let you do it then :)

Dentafrice
25-10-2008, 04:17 PM
I will kthx.

Cause you can't do wordwrap though, and what gives you the right to steal Matt's design and make your own something out of it? 0_o.

Moh
25-10-2008, 04:20 PM
I will kthx.

Cause you can't do wordwrap though, and what gives you the right to steal Matt's design and make your own something out of it? 0_o.
I was only practicing :'(

Jme
25-10-2008, 04:21 PM
Oh god, what have i started? :( Looks like everyone elses is better than mines anyway ahahaha

Flisker
25-10-2008, 04:26 PM
Oh god, what have i started? :( Looks like everyone elses is better than mines anyway ahahaha
Trial and Error :D Best method tbh :P

Dentafrice
25-10-2008, 05:17 PM
Slim ones are close to being done :) The template system is pretty well close to being done.. just have to perfect the text trimming..

http://www.tehupload.com/uploads/app-888331905241858795.png

Excellent2
25-10-2008, 05:30 PM
How exactly would I find the XML for Rejaw to grab my shouts??

Dentafrice
25-10-2008, 05:31 PM
How exactly would I find the XML for Rejaw to grab my shouts??
Why are you asking?

Excellent2
25-10-2008, 05:34 PM
Edit: Got it! Developer was a handy piece of text :P

Dentafrice
25-10-2008, 05:37 PM
http://api.rejaw.com/v1/timeline/user?api_key=api_key&filter=shout&username=username

Excellent2
25-10-2008, 05:40 PM
http://api.rejaw.com/v1/timeline/user?api_key=api_key&filter=shout&username=usernameThanks :) Just got my API key :P

newWORLDorder
26-10-2008, 03:46 PM
These are looking very, very smart.

Offtopic/suggestion. Do you think you guys could make one of these sigs that could display your now playing in iTunes? I think its possible, i dont know :)

Johno
26-10-2008, 03:52 PM
Its possible to do the iTunes one easily using last.fm :)

I was making one for myself, but it was pretty rubbish so just stopped lol.

newWORLDorder
26-10-2008, 04:00 PM
I dont like Last.fm, its just a horrible site and the sigs are rubbish. I would like one that will update when the song changes, simple. Like Calebs old one.

Johno
26-10-2008, 04:05 PM
The one I was making did update when the song updated (because it wasn't cached) - but you have to remember that the reason they don't update automatically when the song changes is because they are cached as multiple requests to the server will slow it down.

With twitter, the maximum amount of requests you can make to the server each hour is 100 - So if the signature wasn't cached then each time someone loaded the signature, another request would be made.

Of course I may be wrong, but I believe that most of that is right :)

Source
26-10-2008, 04:49 PM
Well we have decided on a name and domain, so we will soon be releasing under:

www.socialsigr.com (http://www.socialsigr.com) - Social Signatures

The site will be out in a few days, hopefully we will be doing a 10 - 15 min cache system for services like twitter etc... however we will not hit the requests limit as we are in the process of been white-listed.

Forgot to mention we will support loads of services such as: lastfm, myspace, facebook, twitter, pownce, rejaw etc...

Johno
26-10-2008, 05:30 PM
Awesome news :)

Really looking forward to this, I will definitely be using it!

Dentafrice
26-10-2008, 05:56 PM
I dont like Last.fm, its just a horrible site and the sigs are rubbish. I would like one that will update when the song changes, simple. Like Calebs old one.

My old one was based on Last.FM and used the Last.FM API ;) You could make a iTunes plugin to offset your current song to an FTP server's text file.


The one I was making did update when the song updated (because it wasn't cached) - but you have to remember that the reason they don't update automatically when the song changes is because they are cached as multiple requests to the server will slow it down.

With twitter, the maximum amount of requests you can make to the server each hour is 100 - So if the signature wasn't cached then each time someone loaded the signature, another request would be made.

Of course I may be wrong, but I believe that most of that is right :)

We are currently in the process of being white listed, which raises our requests to 10,000 per hour, and the Twitter staff are being very gracious with this.

There is a nice market for something like this, because to be honest, TwitSig doesn't cut it.. and offering more then one service puts ourselves at a "pretty unique" position.

Johno
26-10-2008, 07:13 PM
I agree, TwitSig is rubbish (and looks terrible) but yours looks very nice and works really well :) - Hope all goes well in getting White-listed :)

Edit: Nice to see the slim one :) Im using it now!

Dentafrice
27-10-2008, 03:16 AM
Awesome! :) More work will be done on this in the coming days, and in the few days we have worked on this, so much progress has been completed.

Want to hide these adverts? Register an account for free!