Been Building Stuff with PHP
Although it hasn’t helped me find a job, I’ve continued to build stuff with PHP. I’ve also been brushing up on my Objective-C. After upgrading to use Version 2 of the GData (YouTube) API I had to upgrade to Version 1.1 of the Twitter API. This took a lot more work especially trying to meet the display requirements. I’m not sure it is perfect, it is close and I’m still not a PHP guy. Once again I’ll decided to include the key code snippets in a blog post as no one uses them if I just check them into GitHub. Plus the code is probably more useful without all the overhead of every other API.
I’ve also been trying to use Masonry on top of my CD Cover Gallery but I have some bugs to work out. I have an open question on StackOverflow but it is plain I need to brush up on my JavaScript a lot more. I’m also not a JavaScript guy. The best code I’ve probably written of late is for searching Twitter and then displaying the tweets. My solution uses CodeBird and follows the same basic techniques as others.
Searching Twitter and Displaying the Tweets with PHP & CSS
- Register an app with Twitter, you will need a pair of keys and two more keys that represent your access token.
- Download and create an instance of CodeBird in your code. Instructions are linked to above.
- Borrow two functions from the web: relativeTime() and linkify_tweet().
- You need to include widgets.js in your client code, Twitter provides this.
- I created two methods, one for searching and one for displaying the returned tweets correctly. I put them in Pastebin in addition to GitHub.
You also need a whole bunch of CSS rules to make it look pretty:
Of course Pastebin always seems a bit wonky or at least their default embed code is… I think it doesn’t like being previewed by WordPress. I’ve also been trying to build another news aggregator/Internet dashboard. I’ve include a screenshot of it. I leverage SimplePie, Topsy, as well as iFrames and JavaScript widgets. I may end up using some of the PHP code above too.




Related posts:
- Searching YouTube with PHP
- My PHP classes for making web mashups
- Feed Me!
- albumCollection.php is starting to come together
This entry was originaly posted on , it was last edited on and is filed under: Internet, Self Marketing and tagged: API, CodeBird, GData, gitHub, iFrame, JavaScript, Masonry, Objective-C, PHP, SimplePie, Topsy, Twitter, widget, YouTube.