Jason Tan

  • Random
  • Archive
  • RSS
  • Ask me anything

PHP Tumblr

During the big storm tonight, I found myself checking out the Tumblr API while watching the news to make sure I didn’t need to hide in my bathroom.

I’ve been all about PHP wrappers for APIs lately. I whipped up a quick class that grabs a Tumblr account’s data and wrote some functions to do stuff with it.

Here’s what I’ve come up with so far.

It pretty much recreates a simple Tumblr theme. The beauty of this is that it only took four lines of PHP code and four CSS rules to create that output:

PHP:

$tumblr = new PhpTumblr("jaytee");
echo $tumblr->title;
echo $tumblr->description;
$tumblr->display();

CSS:

body {font-size: 10pt; font-family: arial, sans-serif;}
.details {font-size: 8pt;}
dt {font-weight: bold;}
.description {font-style: italic;}

There were h1 and h2’s around the title and description, but I can’t get the markup to show here.

  • 4 years ago
  • 12
  • Permalink
  • Share
    Tweet

12 Notes/ Hide

  1. canada-news reblogged this from jaytee
  2. insprd liked this
  3. stabilefeasi liked this
  4. kamikazecalu liked this
  5. tongswhimsic liked this
  6. elegancydiss liked this
  7. veiledpredic liked this
  8. a1027meadnews liked this
  9. gaycutemilf liked this
  10. ivebeatentetris liked this
  11. jorgeledesma liked this
  12. tumblklaat liked this
  13. still-broken-hearts liked this
  14. nb109 liked this
  15. tommybart2000 liked this
  16. ssleep liked this
  17. blupixl reblogged this from jaytee and added:
    could get that class, or find one similar
  18. jaytee posted this
← Previous • Next →

About

Avatar Tumbling through the internets

Me, Elsewhere

  • @jt2k on Twitter
  • Facebook Profile
  • jasontan on Flickr
  • jt2k on Last.fm
  • jt2k on Foursquare

Twitter

loading tweets…

Following

  • RSS
  • Random
  • Archive
  • Ask me anything
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr