Sunday, 1 January 2012

Tumblr Mangles Developer Relations

Last week I logged on to Tumblr and was confronted with this abomination:

missing e notice from tumblr

Missing e notice from tumblr. Way to encourage API development, guys.

Needless to say, this is pretty disturbing, and I wonder what Tumblr is thinking by posting this.

Continue reading: Tumblr Mangles Developer Relations »

Monday, 11 April 2011

Automatically Hash Tagging Text With PHP And MySQL

My recent work on the Google Reader to Twitter interface led me to recognize a serious shortcoming of such a basic system: A lack of support for hash tags.

For those unfamiliar with Twitter, hashtags are basically words proceeded by a hash mark (#). When a word is “tagged”, it becomes a hyperlink to content also containing that term.

Tagging isn’t unique to Twitter. It’s integral to WordPress, Tumblr and many other blogging platforms; Google uses tags (which they call “labels”) in most of their major applications, including GMail and Google Documents.

The reason is simple: People tend to organize information in terms of categories, so interrelating content by linking items that belong to the same categories to one another makes it easier on us to find and process that information.

So here’s a quick and easy script that lets you take keywords / tags / labels / categories / what have you from a MySQL table, run those terms over a string / subject text, and automatically tag that string with those terms.

(In a later tutorial, I will describe how to add new terms to the database.)

Continue reading: Automatically Hash Tagging Text With PHP And MySQL »

Friday, 18 March 2011

Hello, I’ve a question about your post “Using AJAX To Update A Non-Map DIV Via Google Maps API’s GDownload() And GMarker OnClick Event”. Your example is for the V2 version of google maps, so, is it possible to have exactly the same things for the v3 api?

I believe the objects and methods are the same between the two versions of the API, so the answer is probably. Unless, of course, they objects and / or methods have changed. In which case, no.

Ask me anything

Wednesday, 16 March 2011

De-Spamming My Twitter Followers

I’ve recently despammed my Twitter follower list. If you were following me, and now find yourself blocked, you have my apologies. Please send me an e-mail and I’ll unblock you.

Follow me @dougvdotcomThis provides me with a great opportunity to discuss my attitude about Twitter followers and following.

Generally speaking, if someone starts following me, I follow them. If I follow someone, I usually expect to be followed back, and likely will stop following, after a week or so, someone who isn’t following me.

Exceptions to this rule are announcement accounts (e.g, @MSDN, @GoogleCode, @APStylebook) and major celebrities (guideline: someone whose identity has been verified by Twitter, e.g. @SethMacFarlane).

I may decide not to follow someone, but that doesn’t mean I mind them following me. I prefer a two-way street, but that’s not to say that people who only want to listen aren’t welcome to follow me.

I do mind being followed by Twitter accounts that are:

  • Obviously meant only to spam. If all a follower does on Twitter is solicit business, please keep me out of it.
  • Astroturfing. This one is sometimes a judgment call, but if a follower’s tweets are about things other than the kinds of things I am talking about (or the follower hasn’t  tweeted at all), and that tweeter is following a lot of other people with whom he is not communicating / has no common interests, I’ll probably toss him into this category and block him.
  • Patently offensive. Profanity, sexually suggestive comments, edgy humor; these are all fine. Trolling and hating are not.
  • Malicious bots. I am followed by a handful of IT bots; so long as they’re reposting / harvesting relevant info, I’m OK with that. All other bots can GTFO.
Tuesday, 15 February 2011

Correcting Permalinks After Moving Content From A Subdirectory To Root

Ran into this problem with the blog:

As previously noted, I moved my WordPress install from a subdirectory to the root of my Web site. I tried the “Giving WordPress Its Own Directory” method, but I didn’t trust it, so I decided to go ahead with a physical move of the software to root.

As a result, all permalinks to the 200+ articles in this blog became broken, since the subdirectory /blog/ was part of the permanent path root. This was bad, because Google has all those old links wrong, and so does my YOURLS install.

So, I needed a fix, stat. Thankfully, Apache has the mod_alias module, which does a better job of rewriting URLs from subdirectories to root directory than mod_rewrite does.

I specifically used the RewritePermanent directive, which allows one to specify part of a URL string, and to where URLs containing that string should be directed. In my case, I wanted to direct all URLs that contained the  /blog/ subdirectory to the root of my site. Thus:

<IfModule mod_alias.c>
RedirectPermanent /blog/ http://www.dougv.com/
</IfModule>

The first argument after RedirectPermanent is the part of the URL you want removed. The second argument is the URL to which you want found URLs redirected.

This works far better for me than the handful of mod_rewrite rules I tried to accomplish the same basic task.

Your Web server must have mod_alias installed for this to work. Most shared Web hosts will have installed mod_alias, but some might not, or might only enable it for selected domains, as a lot of rewrites and aliases can cause trouble with search engine rankings. Check with your Web service provider.

A hat tip to julianmatz at experts-exchange.com for the tip. All links in this post on delicious: http://www.delicious.com/dougvdotcom/correcting-permalinks-after-moving-content-from-a-subdirectory-to-root