OMFG … Hung Like A Horse … Literally

The two judge chicks [Girls Aloud's Cheryl Cole and Danii Minogue]  look spectacular. I can understand the rise of the Anaconda.

PHP DOM getElementsByTagName() Made Case-Insensitive

Even if HTML allows case insensitive tags, PHP and it's getElementsByTagName is case-sensitive. I don't know about you but for me, this is really messed up. I think you remeber the ultimate el_dom_childrenByTagCB function I shared here.

I'm sharing now it's lighter sister: el_dom_childrenByTagName. The one it evolved from. It's the same without bells and whistles [callbacks]. And it's CASE INSENSITIVE like it's supposed to.
Read the rest of this entry »

Coping With Recent Blog Changes

As of today the blog is private access only. This means if you are not registered you are not browsing it ... at all. For now ... registration is still free but I'm going to add a 5$ fee or smth. very soon [probably for new accounts only] to make sure those who visit don't forget to come back every now and then.

A few things have changed.

  1. Feed access still exists but only Post titles will be available.
  2. Comments feeds are disabled for posts [except infobits] unless you are logged in [This means browsers can still access them].

This will make things a bit more aired. I honestly don't care if I write for an audience of 1 or 1000 as long as they listen and stick around. And the moment the fee kicks in, I'll write a bit more sensitive stuff. Right now, for every post I make, I think like 100 times whether to do it or not. Most times I choose not to. E.g.: It's been rather hard to post the Can You Do This post.

Anyways ... enjoy because, as of now on, you're part of a private community.

PS: Trust me. Asking noobs to hand in a valid email address makes it really private ;)

Severely Lame PHP Web Browser Detection

I sometimes cloak regions of my site based on this really lame Browser Detection function. I don't cloack stuff that search engines would find illegal but there's moments when I need to keep some stuff away from 'obvious' non browsers.

So ... have fun with it: el_http_detectBrowser. And I do know there are better ways like a JavaScript that sets a COOKIE ;)
Read the rest of this entry »

Convert MySQL Database (Schema) / Table To UTF8 Charset

I haven't worked too much in my PHP experience with international (non-English) characters [I used to handle foreign scraping in C++ UNICODEian] and pretty much all I saved in databases was HTML Encoded. Finally decided UTF8 MySQL encoding is not a feature to ignore anymore and is a must have when using the 'funky characters'.

These are my functions I use to bulk convert databases / tables in mysql to UTF8 character encoding. Have fun with them.
Read the rest of this entry »

Scraping Pages Written By HTML-Challenged People

There are moments when you scrape stuff but you notice that, even if your browser shows you a functional HTML page, you just can't parse it using RegExp. Parsing it with the DOM would work but using RegExp just won't. This usually means the HTML is malformed and the DOM/Browser fixes it but ... that would be quite difficult to do yourself as there's a lot of messed up shit people do in HTML.

When I scrape in PHP I fix HTML pages automatically all the time. I don't trust those amateurs out there who don't close tags and so on. But fixing pages in PHP is actually easy using tidy_repair_string and tidy config settings are here.
Read the rest of this entry »

The Download Decade | From Naspter On …

I was fresh in highschool and I remeber the good ol'days using Napster and Audiogalaxy. 30 minutes for two songs on dialup ... in the morning when the phone was cheap. I was going to school at 8AM, phone was cheap before 7AM ... I was waking up at 6:15 - 6.30 and two songs every day :)

Things have changed so fast. Now I run up to 5(real)MB and I sometimes think the dialup period might have just been a dream or a memory of a former life (joking as there's not such thing as former lives/reincarnation).

Read this:

http://www.theglobeandmail.com/news/technology/download-decade/

Napster's - Shawn Fanning

Building Valid Amazon Referral Links By ‘Hand’

I never use the referral links Amazon gives me when using the Amazon Products API [former ECS]. So I need to build my own. And in order to get the referral fee you need to include the tag=...-2[012]. Best way to do it is to encode any valid Amazon URL inside their redirection link. This way you referral tag is also hidden on the final page.
Read the rest of this entry »

Amazon Product Advertising API | Top Level Node IDs

I fixed the Node List. Read below.

It's hard to find the Amazon Top Level Node IDs in a easy way to use as a PHP developer. So I decided to share them here. Use ResponseGroup => BrowseNodes to go deeper from them and find Sub-Nodes. Many niches... many... The Nodes in latest API are fking wrong as Amazon API developers are on crack. But those in version: 2008-08-19 are correct.
Read the rest of this entry »

Be Afraid, Be Very Afraid

Don't ask me why I've posted this under Entertainment. Figure it out yourself. (answers right below the video)

First thing is Matt's hairdo [he lost a bet and his team shaved him] and second is what they say. Let me tell you something. If you hack into a site and drop some links here and there but you don't break that site in any way ... you're my hero.

I miss the days of Wordpress 2.1.3 [it took about 1-3 minutes to crack one ... doing 50 at a time] ... those who know what I'm talking about will sigh. MySQL blindfishing ruled. Truth is I'm not good / patient /crazy / interested enough to find exploits myself. But if others find them ... I can code them ;)

Bottom line is: If you can ... Just Do It! Don't let Matt Cutts stop you.

PS: Don't come with hacking propositions. Turned down enough already! Who would be crazy enough to do it for someone else?