Using the Google Analytics API in WordPress

There’s a great article over at Theme.fm on Using the Google Analytics Data Feed API in WordPress which covers some pretty interesting techniques to grab and make use of data stored in your Google Analytics profile, like what are your top 10 posts this month, or what were the most searched ones, etc. I’ve authored that article so feel free to ask questions ;)

Inspired: Javascript & jQuery Love

Remember the “inspired” blog posts series I started back in November? Well, let’s keep playing that game and today’s topic is jQuery and Javascript. The things you can do with javascript today are pretty impressive and sometimes unbelievable. Starting from simple AJAX calls and ending up with complete rich user interfaces with sweet animation (poke Facebook for instance).

You know I browse the web a lot – StumbleUpon, Digg, Twitter, etc. I go through tonnes of content, so today I made a short list of a few interesting jQuery and Javascript links that made my day! For rookies and for pros, check them out (ordered randomly):

Now you tell me – who needs Flash when you have Javascript? ;) Oh and by the way, if you’ve anything to add to the list (preferably articles published in late 2009) feel free to suggest via comments. If you’re looking for even more jQuery love, follow the real-time search results for the #jQuery tag on Twitter. Cheers!

Twitter Friendly Links: Now In Alphanumeric Mode

Hello my friends! Yes, I’m finally back from my two-week vacation. It was awesome, I spent a week in Magnitogorsk and another one in Sochi. The weather was great, it only rained on Sunday, when I was on my way back. Everything went fine, I’ve seen all my friends, we had a great time. Sochi is okay, getting ready for year 2014, though their airport in Adler still sucks big time!

Anyways, back to Moscow and back to work, and today I’d like to introduce a new feature in the Twitter Friendly Links plugin for WordPress. I call it the Alphanumeric mode, or format, or whatever. You see, people are used to TinyURL and bit.ly, where links are hashed and alphanumeric most of the time. I used a simple base 32 encoding algorithm in my case, plus added a few thousand, so that the links wouldn’t be shorter than three symbols. Not very nice to see example.com/a I guess.. Right? The Generic mode is still there and switched on by default for all the retro guys like me ;) Yes, I do prefer numbers and I know bit.ly would if they hadn’t hosted thousands of new links every day.

Also, I removed the rev=canonical option cause it’s pretty much outdated and encourage you to use the rel=shortlink HTML and HTTP headers, and rel=canonical too, as encouraged by wordpress.org. By the way, it’s pretty cool to see wordpress.com blogs get shortened links by wp.me as announced here: WP.me – shorten your links and they too support shortlink relations (both HTML and HTTP), which was why I decided to stick to them. Right, as Sam Johnston mentioned in the comments, that made over 7 million blogs accept the shortlink relations. Twitter clients should now be thinking about plugging that into the clients. It would make linking much easier, although may be a little more traffic consuming.

Or what if the guys from Twitter would.. Arrgh, hell no =) Impossible…

P.S. Hope you switched to WordPress 2.8.4 in time before the massive password reset attacks ;) I’m kidding, there were no massive attacks.. I guess =)

I’m so glad to be back. Have a great day everyone!

Powered by Delicious: Web Design, Coding & HTML5

This is my first “Powered by Delicious” post, but I plan on writing similar posts at least once a month or so, depending how many links I bookmark. Here’s a list of some of my latest delicious bookmarks, with goodies on web design, coding, html5, photoshop, javascript and a bunch of other stuff.

URL Shorteners and the Linkrot Apocalypse

First of all I’d like to thank you all for your support on the Twitter Friendly Links plugin for WordPress. It started out as a fairly simple URL shortener tool. Now it’s got loads of new options and some compatibility fixes. Keep the suggestions coming :)

Today I came across a bunch of articles about link relations, the way Google and other search engines treat them, and the way a variety of scripts, plugins, tools, etc. work with them. It seems that there isn’t a strong standard yet (perhaps everybody’s waiting for W3C) so most clients now support different styles.

I’m talking about the shortlink, short_url, short-url and other relations in HTML and HTTP responses. In the Twitter Friendly Links plugin I went with the shortlink specification as stated here although there’s a competing alternative which looks alike. Anyway, I wrote about extending the plugin and creating a little API that could transform long permalinks to short ones within the blog. It seems that there’s no need for that. If Twitter could access the page we link to, look out for the shortlink in the head section (or perhaps the HTTP response) then return THAT short link instead of the old-fashion bit.ly trimmed one, that’d be great, right?

There’s also one called rev=canonical, which pretty much does the same as a link rel=shortlink. It’s being used on many sites right now, though I’m not sure that Google reads that at all. Webmasters confuse this with the rel=canonical which on the other hand got Google support in February this year. The idea behind rev=canonical is to specify the reversed canonical, i.e. (perhaps) a shorter link to the same page, but it came up with a bunch of security issues for cross-domain linking (like when specifying a short link generated via TinyURL). Also, the rev attribute is gonna be gone in HTML5, but until then we’re free to use it, so that’s why I included this option in the lates (0.3.4) release of Twitter Friendly Links.

If you’re interested in linking relations, you might want to read:

Note, that these are just thoughts, standards yet to come :) We DO have to get rid of those TinyURL ugly links though somehow. Good luck!

P.S. Twitter Friendly Links is now compatible with AskApache Google 404.

New WordPress Plugin: Twitter Friendly Links

So, you promote your blog posts via Twitter, huh? Me too. And those long blog post URLs, ugh! Yeah, we got rid of those using URL shortening services like TinyURL and tr.im but what about the name and/or brand? Your blog posts might be fab – very interesting to read and three thousand comments on each. But are you getting people to remember your website address in Twitter? No. Do you get backlinks from Twitter using TinyURL? No. Can you measure site statistics from TinyURL links on Twitter? No.

I’ve been inspired by a blog post (jeez I can’t remember where I read it, I’ll add the link as soon as I do) about the importance of posting nice links into Twitter. So I decided to create a plugin for WordPress, that would allow you to have your own TinyURL within your domain name. Here’s a quick example:

https://konstantin.blog/wordpress/plugins/twitter-friendly-links/

Might look like this in Twitter:

https://konstantin.blog/712

Which will take you to the page above with a simple redirect. I called the plugin Twitter Friendly Links. The go part of the address is customizable (dunno why I picked “go”, it may be “to” or just “g” for go or “p” for post – any way you like it). The TinyURL link (http://tinyurl.com/c9wpdc) is currently 1 symbol shorter, but it IS very ugly, isn’t it?

Also, there are some URL shortening services that open up the desired link in a stupid frame with stupid ads. What if TinyURL decide to make some money on ads? My suggestion: move on to your own domain. Oh and what if you have a very long domain that doesn’t fit into 140 characters in Twitter? Unlucky! ;)

Here’s the plugin page: Twitter Friendly Links

Please don’t forget that I am in the middle of the development process, so don’t shout at the first couple of betas, okay? And gimme feedback on anything that comes into your head. Also, stay tuned for the next release this week. If everything goes as expected you will have an options page in your wordpress administration as well as short links to copy to clipboard for every post.

Cheers!

WordPress Junkies: Blogging via iPhone

I wrote about offline blogging with Windows Live Writer some time ago, and now I realized that it’s not that fun! Alright, I have two good news. The first one’s that I received approval for my second wordpress plugin (Related External Links) to be hosted at the official WordPress Plugin Directory. I commited the first beta a few minutes ago so go ahead and vote it up: Related External Links (thanks!).

The second news is… Y’know I’ve been dreaming about it since it was first announced. Yeah, I finally got myself an Apple iPhone!! Woot! It’s so sad that Moscow hasn’t got 3G internet yet (MTS announced it for the end of 2009) but I’ve got Wi-Fi at home and office plus EDGE everywhere else, so I guess I’ll survive. The first thing you definitely have to install on a brand new iPhone is TwitterFon. Get it for free from the iTunes Application Store (via iTunes on PC or App Store on your phone) and you’ll be tweeting 24/7, sending TweetPics along with your iPhone GPS coordinates. Jeez I’m so excited (BTW follow me!).

Anyways. Back to WordPress. I really appreciate that the WordPress team made this iPhone App. You can get it for free at the iTunes Application Store. It’s very user friendly and all the functionality you’d need is plugged into this little app. I’ve made some screenshots (thanks to @CMoz) to show you the whole process. Make sure you read the comments to each shot.

One more thing. If you’re into iPhone, you should definitely check out: Apps and Hats. It’s a brand new video blog about iPhone apps, which is launching 20th of March. Make sure you subscribe to their RSS feed and/or follow the Apps and Hats Twitter account. I think they’ll be using TwitterFeed to tweet their blog updates. Cheers!

Removing Comments Author Links

Askimet (the anti-spam plugin for wordpress) is great, but when it comes to readers commenting posts and leaving backlinks to their sites, Askimet doesn’t count that as spam unless the message doesn’t look like one. Yeah, wordpress marks them with a ‘nofollow’ attribute, but search engines aren’t the worst case in this situation. It’s pretty good if readers leave backlinks to sites that are more or less relevant to yours, but what if it’s something about travel and hotel bookings? That would piss me off…

You can manually edit the comments and remove backlinks, but you’ll get annoyed doing that with ~100 comments per day. Anyways, here’s a quick tip of how to remove all author links forever.

Go to your wordpress admin panel, pick the ‘design’ section and click ‘theme editor’. Now, in the list on the right you’ll see some files related to the current theme. You’ll have to find the one that’s ‘driving’ comments. This can vary from theme to theme, but most likely it will be called comments.php.

Then find something similar to:

<?php comment_author_link() ?>

And replace it with:

<?php comment_author() ?>

Voila! And no more author links in comments ;) Good luck!