Showing posts with label hacking tips. Show all posts
Showing posts with label hacking tips. Show all posts

Saturday, August 4, 2012

WordPress Plugin to fix Facebook Like Thumbnail

Today, Facebook pushed live another change which made Like button work similar to what we had known the Share button to do. Just to brush up, Share button was used to show the Title, Description and a screenshot of the page which you shared and the Like button would only show up as a line that the user liked XYZ Story on ABC site. But now after the new change is live, like button functions the same as the Share button.
Here is a screenshot of how the new like would show up on your profile:
facebook-new-like
I don’t like the move as people tend to like a lot more stuff than what they share. This is going to stuff the stream with lots of noise. After like is not, and can’t be equivalent to share. I might like a post on Ubuntu tutorial but is that something I would want to share with everyone else. No! But that’s totally a different story.
Coming back to the point, many sites would show up random image of their page instead of an appropriate image. I have seen this on several blogs including mine, that sometimes an advertisement image would show up (from the sidebar), or a totally unrelated image of my another project (from the footer). so, I took this opportunity today to fix it for everyone.
You can check what thumbnail would Facebook show for a particular page by using their Lint tool.
The problem can be solved for non-WordPress based or html sites or whatever, by adding this line to their head section.
<link rel="image_src" href="http://example.com/logo.png" />

Deal with Blog Scrappers getting indexed quicker than the original site

Although its not something that one should be worried about as such things often happen, and its actually a sign that you are growing. I would suggest you to just keep going on with the quality content on your site and not to worry about them scrapping your articles. Google does a pretty good job in killing spam blogs. They generally gain traction for a month or so and then they are completely gone.
But sometimes it might happen that the spam blog site might be getting indexed quicker than the original site when your original site is pretty much new, so it can be a temporary hold for your organic traffic growth. In such case, we can deal with them by delaying the feeds for a certain amount of time as all these scrappers work by pulling articles from your feeds and then publishing your articles on their site.

 

Last.fm free Internet Radio hack

Last.fm is a great service which scrobbles (track) what music you listen to and then recommend you new music based on what you like to listen. You can totally keep your music database online and discover new music that you will actually like. It works great. It offers an Internet radio service which is paid for countries other than US / UK / Germany. So, if you are from any other country, the trick is to use a country based proxy for listening to your Last.fm radio for free.
For the purpose of this post, I assume that you are ready running the Last.fm scrobbler (tool which sends your music statistics to Last.fm). In the menu, select Tools, and then options.
last-fm-scrobbler

Using Ubuntu Notification System – NotifyOSD

Ubuntu features a notification system, where you can see a message notifying you about some particular event. Rhythmbox uses it to show the next track when a track ends, Filezilla shows a notification that file transfers are completed when its window is not in focus (Very handy!) and so on several applications can use it to notify users in the same way (keeping the UI consistent, which is a good design principle).

Rhythmbox Song Notification

rhythmbox notify

Filezilla Transfer Complete Notification

filezilla notify

Which one to use WP_Query vs query_posts() vs get_posts()?

There are several instances where we want to display content other than what WordPress displays at a particular page. There are three methods which you can use, but each of them is meant for a specific purpose, otherwise why would they have existed? Makes sense? Good!
Some tutorials use one, some other and many of them are in fact incorrect because they might seem to get the job done but in certain cases they cause side effects, such as modified global variables on which other functionality may rely.
The fight is in between using WP_Query or query_posts or get_posts. Rarst created a great chart to explain what is going on in the three approaches to make it easy to understand the working. which I totally recommend checking out.
wordpress query

WordPress plugin Facebook Like Thumbnail Updates

I have updated my WordPress plugin to fix Facebook Like Thumbnails to version 0.2 which I am sure will make the existing users happy!
Some of the users who quickly upgraded might be facing issues because of a silly mistake on my part. If the plugin has disappeared from the plugins listing, then you would have to delete the folder “facebook-like-thumbnail” folder in your plugins folder (/wp-content/plugins/) and then reinstall the plugin by typing “Facebook Like Thumbnail” in Add New Plugins screen. I apologise for the issue, please excuse me, I am not used to pushing updates to public repositories.
The plugin now features an options pages which can be found under Settings > Facebook Like Thumbnail. You can specify your default thumbnail image on that page, no more code edits are required. This was a necessary move as the users would have to edit the plugin to specify their default image after every upgrade.