HTML

Post To Tumblr – v0.2

Just a quick update to my first chrome extension.

Following a request someone left in the comments I have now added an option to set how the post should be published. So now you can choose whether you want your cat with a lime on its head to be posted to your drafts or your queue or simply to your default wall.

You can grab the new version in the usual place on the Chrome Extensions Gallery -> https://chrome.google.com/extensions/detail/dbpicbbcpanckagpdjflgojlknomoiah?hl=en

I think it updates by its itself, but I cant be sure!

Enjoy!

My First Chrome Extension – “Post To Tumblr”

Mummy wow! Im a big boy now! I have just published my first Chrome extension.

It was really annoying me that when I found a funny cat or some other silly image I would have to go through a whole ball-ache process to get that image on my Tumblr account.

What I really wanted was some right-click-post action going on and wondered why no one had one it yet. So with an hour or so to spare I whipped this extension up really quick.

It uses the Chrome 6 Context Menu API so you obviously need to have Chrome 6 to be able to use it.

Currently it only posts images as that’s all I needed for now but if enough people want more then ill whip out the other data types.

The source couldn’t be any simpler really, infact this is it here:

  1. chrome.contextMenus.create({"title": "Post Image To Tumblr", "contexts":["image"], "onclick": postImage});
  2.  
  3. function postImage(info, tab)
  4. {
  5. var email = localStorage["tumblr_email"];
  6. var password = localStorage["tumblr_pass"];
  7.  
  8. if(!email || email=="" || !password || password=="")
  9. {
  10. alert("Need to set your Tumblr username and password in the options before posting!");
  11. }
  12. else
  13. {
  14. var o =
  15. {
  16. "email":email,
  17. "password":password,
  18. "type":"photo",
  19. "source":info.srcUrl
  20. };
  21.  
  22. var success = function(data,textStatus,request)
  23. {
  24. if(textStatus=="success"){ alert("Image posted to Tumblr. Image -> "+info.srcUrl); }
  25. else { alert("Bad email or password"); }
  26. }
  27.  
  28. $.post("http://www.tumblr.com/api/write",o, success);
  29. }
  30. }

Simples!

Theres even an option page where you put in your Tumblr details:

Oh, there is one issue.

No matter what I tried I couldn’t manage to get the Tumblr API to return an error. So if you enter your username or password incorrectly it still reports success, not entirely sure why, if someone knows I would love to hear why!

Interested? You can go grab it over on the chrome extensions gallery page -> HERE

The Case of The Transitional Doctype

I took a little break from my ‘top secret’ project (more on this coming soon) this evening to do some much needed repair work on one of my flash games portals www.worldsbestflashgames.com.

Top of my list was the fact that the index page doesn’t render correctly in IE7. What makes it odd is the fact that the category pages which are essentially identical to the index page rendered fine.This is what it looked like:

ScreenHunter_01 Dec. 10 19.28

Normally when you hear that there is an issue with a site on IE and not on FF or other browsers you automatically assume its CSS, and so did I. After stripping the site down to its bear bones however, comparing the index page against the category page I will still getting this oddness.

To cut a long story short I worked my way up from the bottom of the page to the top until I reaced the very top line:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

This line was the only line that differed in the index to the category page, which read:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">

So I took out the “Transitional” and low and behold it worked!

ScreenHunter_02 Dec. 10 19.41

No idea what Transitional does, but I hope this helps someone else out in the future!

 Scroll to top