dannytalk ™ A Danny Ng Blog

Danny Ng blogs about SEO, Web Development, Christianity, and Life in General

Archive for July, 2008

Are petrol prices fluctuating proportionately?

Posted by danny On July - 31 - 2008

According to Yahoo! News, oil prices closed at US$126.77 per barrel yesterday, down almost $20 from July 11 record high prices of US$147.50 per barrel.

If you do the maths, that’s about a 14% in falling costs for petrol. A few weeks ago, I saw petrol prices in Sydney go up to about AU$1.68 a litre and last Tuesday, I saw petrol prices were around AU$1.49. Tuesday is meant to be the “cheap fuel day” here.

Now if you do the maths again, that’s about a 11.3% in price reduction, which is inconsistent with the 14% fall in barrel costs.

I’m not entirely sure if my assumptions in calculations are right, but why aren’t the prices fluctuating proportionately?

Are the major oil companies pocketing big time from the large fluctuations in petrol prices due to supply and demand? Well according to The Age, British energy giant BP announced a net profit of US9.47 billion in the second quarter, up 28 percent.

So yes, I’d probably say so. If you somehow find a “black gold” mine, please let me know as I’d be interested in investing in it.

Bookmark This!

http://www.dannytalk.com/wp-content/plugins/sociofluid/images/digg_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/reddit_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/stumbleupon_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/delicious_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/furl_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/newsvine_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/technorati_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/google_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/myspace_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/facebook_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/yahoobuzz_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/sphinn_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/twitter_48.png
Categories: News

Apple iPhone continues to “sell out”

Posted by danny On July - 30 - 2008

I’ve been trying to get my hands on the iPhone 3G on the Optus network but it seems that every Optus store is sold out except for the Apple store. The last one I visited was at centre point and the guy said that it was sold out for another 3 weeks.

I never thought this would continue after nearly 3 weeks of the iPhone 3G official launch but it seems that Apple is trying to keep the hype up by keeping up the demand and reducing the supply to their Optus affiliates so that everybody can say, “Oh my gosh, the iPhone is still sold out. It must be so great! Yadi yadi ya…”.

However, the Sydney Apple store does have stock but they usually close registrations 2-3 hours before close of business to ensure everybody gets out of the building by that time.

Last week I visited the Apple store about 4 times after work and got there around 6.15pm, only to be turned down each time by their staff because registrations are closed. They suggested that I either come early in the morning (yes yes, they continue to remind me that the store opens at 8am but I can’t be bothered to wake up that early for a phone) or during lunch time.

Oh by the way, they also said that the registration process may take up to 2 hours. That is another factor that I cannot be bothered to get the iPhone just yet.

So I’ve gone ahead and taken up Vodafone’s unrestricted offer where you get a bonus $20 credit if you recharge by 31st July. Now I don’t even have to think about the iPhone for a month and hopefully by then will the stupid queue decrease and other Optus stores won’t be entirely sold out.

Bookmark This!

http://www.dannytalk.com/wp-content/plugins/sociofluid/images/digg_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/reddit_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/stumbleupon_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/delicious_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/furl_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/newsvine_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/technorati_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/google_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/myspace_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/facebook_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/yahoobuzz_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/sphinn_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/twitter_48.png
Categories: News

How to 301 redirect from Blogger to Wordpress

Posted by danny On July - 26 - 2008

As promised in my previous post (301 Meta Refresh Redirects: How Google and Yahoo Sees It), I will show you a script I wrote that will handle 301 redirects from Blogger to Wordpress using the meta refresh tag and javascript.

I have tested it on my old blogger (http://dannynsl.blogspot.com) and it seems to have worked fine so far.

There are a few steps you will first need to do.

  1. Install Wordpress on your domain. There should be installation tutorials on the website. I haven’t had time yet to do my own installation tutorial.
  2. Import your Blogger posts into Wordpress. In your dashboard, go to Manage and then Import.
    Wordpress - Import Blogger
  3. Change your permalink structure. In your dashboard, go to Settings and then Permalinks. The Day and name or Month and name settings should work. However, for my script I think Month and name should be safer.
    Wordpress - Permalinks Settings
  4. Use my javascript code just after the start of the <head> tag in your Blogger layout template. Note: Please make sure you do a backup before making changes. The variables that you need to change are old_root_domain and new_root_domain. This script handles redirection of individual posts, monthly archives and yearly archives. Anything else it will redirect to your homepage.

    When assigning values to old_root_domain and new_root_domain, DO NOT use ‘/’ at the end.

<script type='text/javascript'>
/*
 * Written by Danny Ng (http://www.dannytalk.com/2008/07/26/how-to-301-redirect-from-blogger-to-wordpress/)
 * Free to use and distribute but must keep this comment in place.
 */
var post_regex = /^http:\/\/(www.)?.*\.blogspot\.com\/\d{4}\/\d{2}\//;
var month_archive_regex = /http:\/\/(www.)?.*\.blogspot\.com\/\d{4}_\d{2}_\d{2}_archive.html/;
var year_archive_regex = /updated-min=\d{4}/;
var label_regex = /search\/label\/.+/;
var old_root_domain = 'http://dannynsl.blogspot.com', new_root_domain = 'http://www.dannytalk.com', tag_url = '/tag/', redirect_suffix;

if (post_regex.test(location.href))
	redirect_suffix = (location.href.search(/www/i) == 7) ? location.href.substring(old_root_domain.length+4, location.href.length-5) : location.href.substring(old_root_domain.length, location.href.length-5); // -5 to strip .html
else if (month_archive_regex.test(location.href))
{
	redirect_suffix = (location.href.search(/www/i) == 7) ? location.href.substring(old_root_domain.length+4, location.href.length-16) : location.href.substring(old_root_domain.length, location.href.length-16); // -16 to strip _XX_archive.html
	redirect_suffix = redirect_suffix.replace(/_/g, '/');
}
else if (year_archive_regex.test(location.href))
{
	redirect_suffix = year_archive_regex.exec(location.href).toString();
	redirect_suffix = redirect_suffix.replace(/updated-min=/, '/');
}
else if (label_regex.test(location.href))
{
	redirect_suffix = label_regex.exec(location.href).toString();
	redirect_suffix = tag_url + redirect_suffix.split('/')[2];
}
else
	redirect_suffix = '';

document.write("<meta content='0;URL=" + new_root_domain + redirect_suffix + "' http-equiv='refresh'/>");
</script>

If you want to do a 302 redirect equivalent, just change the number in the meta content from 0 to 1 or 2.

Hope this works for you and please let me know if there are any bug issues.

[edit date=26/07/08]

I just fixed the code to accommodate blog addresses with ‘www’ subdomains. As for redirects for labels, I’ll try to update the code for it tomorrow if I have time.

[/edit]

[edit date=27/07/08]

I’ve added a new regular expression to handle labels and also another variable tag_url that points to your permalink structure for tags or categories.

Wordpress - Category, Tag edit

This setting can be found under Setting, then Permalinks and just scroll right down to the bottom. You will need to edit the variable tag_url to what you’ve sent in the permalinks structure. Make sure you add the ‘/’ at the end of it.

I think by default, Wordpress automatically imports posts from Blogger and sets the labels to categories instead of tags. In this case, just set the variable to the category slug name unless you can be bothered to go through all the posts and set them as tags instead.

[/edit]

[edit date=14/02/08]

Just found a bug (thanks to Chris Lee) that the redirection didn’t seem to work in IE7. For some reason I needed to add URL= in the meta content attribute for the redirection to work.

Basically I just changed,

document.write(“<meta content=’0;” + new_root_domain + redirect_suffix + “‘ http-equiv=’refresh’/>”);

to

document.write(“<meta content=’0;URL=” + new_root_domain + redirect_suffix + “‘ http-equiv=’refresh’/>”);

Please let me know if you guys ever come across bugs for this script and I will try my best to fix it as soon as possible :)

Happy Valentines Day everyone!

[/edit]

Bookmark This!

http://www.dannytalk.com/wp-content/plugins/sociofluid/images/digg_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/reddit_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/stumbleupon_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/delicious_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/furl_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/newsvine_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/technorati_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/google_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/myspace_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/facebook_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/yahoobuzz_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/sphinn_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/twitter_48.png

301 Meta Refresh Redirects: How Google and Yahoo Sees It

Posted by danny On July - 24 - 2008

Normally the best practice for 301/302 (permanent/temporary) redirects are through your web server. However, you can only do this if you own your own domain. So what happens when you’re using a free webpage service such as Blogger, Wordpress and Typepad, and you want to do 301 redirects to your new website?

If you’re thinking of doing Javascript redirects, this isn’t highly recommended as Google and Yahoo web crawlers won’t be able to follow the redirects, which will affect the destination’s ranking and indexing.

Although not the best, your next best bet is using the meta refresh tag to do your redirections. It seems that Google recognises meta redirects and Googlebot should be able to crawl to the new page, according to Google’s Webmaster Help Center.

Yahoo’s Search Help also seems to recognise meta redirects and the crawler will be able to follow the redirects.

It appears that a meta refresh delay of 0 or 1 second will be considered as a 301 redirect and anything longer is considered a 302.

I will try to post a javascript solution that will be able to handle redirects from your old website to appropriate pages of your new website this weekend.

Bookmark This!

http://www.dannytalk.com/wp-content/plugins/sociofluid/images/digg_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/reddit_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/stumbleupon_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/delicious_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/furl_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/newsvine_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/technorati_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/google_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/myspace_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/facebook_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/yahoobuzz_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/sphinn_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/twitter_48.png

Google Apps Server Error

Posted by danny On July - 23 - 2008

Have you ever deleted your Google Apps account linked to your domain? Well I did last night and it was disasterous.

The reason I deleted my Google Apps account was because I wanted to change the domain admin email of the account but for some reason I couldn’t.

So I thought I’d delete it and start fresh again immediately. However, when I tried signing up again, I get this error

Server error

Sorry, you’ve reached a login page for a domain that isn’t using Google Apps. Please check the web address and try again.

I was left baffled for many hours trying to figure out how do set it up again as I like using Google’s email, docs and calendar.

I even contacted my web host asking them to reinstate it but instead they got me to click on a feature that lets Google host my website entirely.

This lead to my website being down for half a day to allow the DNS to propogate. Obviously I was extremely pissed about this and asked them to immediately rectify this which they did (thumbs up for customer service).

Lucky for me, this website isn’t an e-commerce website or else I’d be loosing money!

So I spent many hours searching for a solution and for some reason the search results didn’t really give me good answers. I really had to dig around until I decided to visit Google’s help centre (which I should’ve done in the first place!).

There are 4 reasons why you’ll get the above error.

  1. A Google Apps account doesn’t exist for the domain name you’ve entered
    You’ve tried to access the Google Apps control panel without having yet registered for the service. As a result we weren’t able to locate a Google Apps account for your domain. To sign up for a Google Apps account with your domain name please visit www.google.com/a.
  2. Your Google Apps account was deleted.
    If you’ve recently deleted your Google Apps account it will take five days for it to be entierly removed. After five days, please visitwww.google.com/a to sign up for a Google Apps account with your domain name.
  3. Your Google Apps account was deactivated because we were unable to verify your domain ownership.
    If you signed up for Google Apps and didn’t verify domain ownership, you’ll receive an email notification at your secondary email address that indicates the domain will be removed from our records. Once the account is closed, it will take five days to be fully deleted. This will delete all data associated with the existing Google Apps account. After five days, please visit www.google.com/a to sign up for a new Google Apps account with your domain name.
  4. You’re trying to access the control panel for a domain that’s registered as a domain alias
    The domain you’ve supplied is currently configured as a domain alias for another Google Apps account. Please check with other members of your organization who may have already provided this domain name.

So there you have it, it takes 5 days to delete your account entirely. You can read more on it from Google’s Help Centre for Google Apps.

Bookmark This!

http://www.dannytalk.com/wp-content/plugins/sociofluid/images/digg_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/reddit_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/stumbleupon_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/delicious_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/furl_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/newsvine_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/technorati_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/google_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/myspace_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/facebook_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/yahoobuzz_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/sphinn_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/twitter_48.png
Categories: Web Development