Quotes: Joy is prayer - Joy is strength - Joy is love - Joy is a net of love by which you can catch souls. (Mother Teresa)
5ubliminal@twitter

Content filed under Snippets

5ubliminal's YAMS

Been so busy these past weeks didn't notice the CSV thingy present in Google Trends. So my old Google Trends script can now be taken to the next level and it has been taken by Bogdan's nTrendsMaster over at ProfitHunter.ru.

Easy method to build the most simple login box for your sites' control panels using the HTTP hardcoded 401 AUTH-entication. Of course it sounds easy but there are always challenges.

Regardless of the small degree of diffculty, this method pays off big times as it'll be a plugin to use on and on for any control panel you build. It's also ultra-cross-browser.

14.05.2008 I updated this class adding a new post function metaWeblog compatible provided by Maximus Marius from seo 4you. I added a few tweaks to it, tested it and it works. You can now enjoy tags support. I also added another fix mentioned by netizen.

I just finished coding a implementation for 95% of the XMLRPC functions in Wordpress. It can successfully post, delete, edit, manage categories and so on! It's Wordpress on remote control.

Someone asked me how to use the infamous eHttpClient to count the Google search results and this is my reply and a little kiss script.

PS: I added GZip compression to eHttpClient and I'll post it these days. Cheers!

I use innerHTML and outterHTML a lot but I just came to realize they don't work in Mozilla (I hate FireFox). As my Javascript skills are a bit rusty I had to find some alternatives and found a bunch of JS code lines to replicate the behaviour I needed.

Not much to write here except to point you to the original post about the text zones extraction, a post that was quite popular back in the days.

It's time to back it up with code … 5ubliminal style:)

Update: Nogenius warned me about a bug which I just crushed. GETs didn't work after POSTs. The fix is commented in the code. Search nogenius. Thanks!

I expanded the previous sample of Basic cUrl and PHP Usage and converted it to a class for easy further updates. I also added the headers processing which can be useful to handle cookies. It is now easier to use but basic PHP knowledge is required.

Let's say I have a string where I know a certain substring repeats 5 times. I want to replace occurance (0,2,3) with another string but leave occurence 1,4 alone. Or just replace the first 3 occurences and let the rest live. Of course this needs to be case sensitive/insensitive.

While I'm at it I want to replace from the end and replace occurence -1 too which is last. Can you feel my pain?

The script provided has been written and tested on PHP5 and works. It should be PHP4 friendly. If you got problems… holler.

Update: When I pasted this script I had some problems with the slashes that got lost on the way. I did not notice it and most who use it fixed them but I changed the script now to a functional version.

This function should not be abused but it does have some legitimate uses. Google.com would not consider them legitimate but there are …

So use this to get the Google search engine results (SERPs) in your PHP script easily but at your own risk. And use common sense and do not hammer servers!

The tools PHP provides for send emails are simply hilarious and when it all comes down to more advanced stuff you gotta make your own functions.

I went one step further and provided this pretty SMTP class for use in PHP to deliver emails. It supports a lot of cool features including SMTP AUTH for servers that require login, attachments, to, cc, bcc types to destinators and MIME encoding for HTML messages.

Learn to use it and, as my explanations surely suck, test it and ask your questions.

I shall reply promptly!

Normalizing special characters from languages like: Spanish and French to their ASCII equivalents is not a really easy task in PHP. My goal is to turn all characters that resemble a t (Ţ) to a t and all those that resemble a c (Ç) to a c and all those that resemble an o (Ŏ) to an o and so on … you get the idea.

And the provided code will do just this!

strip_tags php function to strip html tags from text has some small issues which lead me to write my own replacement for it. It might come in handy to many of you good PHP coders out there.

This is an updated version so if you got it already overwrite it with this new one.

Given too many choices people will make the wrong ones. So, we should guide them (and their navigation throughout our sites) the right way - our way!

How can you find out? and Why you need to know it? Importance of knowing a blog's homepage url.

Simple PHP trick to create pseudo-plugins to alter the HTML your site outputs to a browser and perform some custom actions on it right before it goes out.

Easy to use and I use this constantly for quick'n'easy changes to my sites to avoid recoding.

A simple function to variate text based on given patterns that can serve a lot of purposes.

I challenged myself to build a better highlight_string function for pretty PHP output and suceeded. It was not easy but I'd say it was all worth it!

Unzipping Zip archives in PHP is a very important task for any web-developer serious about his work. Applications are limitless but it's best used for ploading multiple files zipped and maintaining directory structure.

In this tutorial you will find a PHP function to help you handle all your basic PHP unzipping needs. Not suitable for huge files but perfect for everyday needs.

Google Suggests can give us up to 10 related keywords suggestion which we can easily use ourselves in PHP scripts.

Over a month ago I published a function to extract Domain From URL in C++. I ported it to PHP and this code will extract Domain Name from Host Name or URL and will Contain Domain, TLD and maybe a Country Level TLD (2nd level TLD).

Easy to use PHP code to access Google Trends data automagically from your own PHP scripts for an idea on keyword search volume.

I will teach you how to negotiate and squire any TLD you might need.


What else is there to say when we look at this image?

To take full advantage of a users screen resolution one needs to know it first. As there is no way to find out in PHP we combine a bit of Javascript and PHP to find out the visitors Screen Resolution Size.

I often make live changes to my site and I need to retrieve the complete image of the site locally. I don't have telnet and anyway to zip in cPanel except a complete account snapshot so I had to find a method myself. And I did!

Conversion between Single-Byte and Multi-Byte (ASCII and UNICODE) Strings is easy but what if it became easier. One class constructor will expose the converted string so you can use it as you need to. Buffer is handled internally so make sure to copy it.

IE

Even if the user experience with Internet Explorer is not the highest with its CSS problems mostly, IE is a blessing for coders. If you learn to automate it properly you can go as far as your with and as you patience takes you.

I'm sure you'll find use for this complete list of whois servers. It features all country codes as I parsed it from IANA.org. Enjoy it.

An all-pourpose buffer class so you forget about malloc, realloc, memset, memcpy and all the memory functions that give us headaches.

After posting the extremely Simple Calendar generator function I could have sworn I helped many PHP coders add custom calendars to their sites but the truth was a bit different!

I needed this to play with some Whois queries and, as I did not find any code online to do it, here it is. Might come in handy to some C++ coders who need to convert URLs or host names to domain names.

This page will point you to the article content scraping scripts I published. Bookmark it as any article educational scraping script will be linked here.

Free articles for the taking should be easy to access and retrieve. I made this script especially to demonstrate you how to use PHP and cUrl in order to get the content you need from ArticleInsert.com.

Don't you want pingback ability in your custom built blog? Here's the script. Integrate and enjoy pingback. It was a tough nut to crack but I nailed it. N-Joy!

Just an easy function to get a functional calendar into your website. The one used to generate the calendar you see here on the right.

Would you consider a street address written in lower case different then one written in upper case? It appears Google, as specs teach it to, considers URLs where only letter case differs as different. This is correct according to specs but should there not be any common sense involved? What length is Google willing to go to artificially inflate their index.

Do you need to fake your user agent and verify / visit other sites? Is it important for you to see how sites are seen by Googlebot and so on? Do you need to pretend you are a different browser? Learn to easily change your HTTP User-Agent!

Learn to use the daterange advanced search operator to see which pages Google considers more important on your site and see what's fresh in the index. By restricting searches to time spans you can converge on certain moments and see only what's the buzz.

If you pay attention long enough you can spot your strong pages and your weak pages also.

After the article explaining the method I coded this easy to use PHP script that does the trick for you and also caches the results for further use. This way your site will not be slowed down at all.

Why you should consider output buffering for your PHP sites.

A simple and somehow functional method of finding the open mysql connections in PHP. PHP does not provide and express way to do it but I found a way that might work ... might! It requires a clean coder to function.

Decode the search phrases (queries) that deliver visitors to your site from popular search engines. Use the PHP function provided to learn what they are searching in real-time and guide them better on your website.

PHP has gzencode but lacks the gzdecode version. So here it is!

Use this easy PHP function to parse HTML for hyperlinks and list them along with their attributes.

Good method to check on link exchange partners or count links or external links on a page.

Free open-source simple Ip2Country PHP class that allows you to translate any valid ip address to a country code and act in your visitors best interest.

Easy to integrate in your site, plug-in and play functionality.

Often you need to check if an email is valid and if you can send to it prior to accpeting it as valid. This is the solution you need.

PHP Globals Variables Trick in Function Scopes

I was working on this site and had to deal with a small problem of using a lot of global variables on some internal functions. I found a cheap trick to handle this.

The PHP code mentioned in the Tutorial will import all global variables into your PHP script function and allow you to use any of them without the need to declare them one by one.

Websites have several PHP files that are included and have no usage by themselves. They work as plugins for the entire site and only fit in the big picture.

GoArticles.com is a huge databse with nonsense articles published only for SEO porpouses. Worst of all, the site is havily cloaked and I will provide an educational script to uncloak it!

Educational Google Cache, PHP and cUrl Script

{Black-Hat Use Not Allowed}

Images as buttons in HTML forms are cool but not really easy to implement them as you can't use value attribute on them. So you can't use mutliple images and easy see which of them was clicked.

Check out the PHP function that comes along and makes it all so easy! Image buttons will be for your website and coding skills as simple to use as good looking.

Even if cUrl is really easy to use if you enjoy to KISS (Keep It Simple Stupid), forums are still swarming with people that need some help. I'll teach you here the basics in combining PHP and cUrl to get 99% of all you'll ever need done with them done.

I'll provide 2 easy functions + 1 helper to make cUrl and PHP a little easier for you.

Why would someone need access directly to cPanel?
It's easy: You can do many things like, manage multiple hosting accounts in one, keep track of your addon or parked domains, retrieveing raw log files and using them with your own analyzer scripts.

This class is not for the unexperienced PHP programmer and you need intermediate skills to advanced to make use of it to its fullest.

The real reason I wrote this script is to retrieve my raw access logs and analyze them but posibilities are endless. You can use it to access any page in cPanel and even do posts. You can create a centralized domain management console for all your cPanel php hosting accounts put into one.

5ubliminal's TellinYa.com SEM & SEO Blog © 2007 - All rights reserved unless mentioned otherwise .
Rendered On : [Friday, 21 November, 2008 - 09:16:11 GMT]   No Ajax / Flash Used Here
" Content filed under Snippets "