Archive for the ‘CodeIgniter’ Category


May 14, 2008 by Alex Polski | 3 Comments »

Bugfixes in Curl library for CodeIgniter

Dear friends! There were two bugs fixed in Curl library for CodeIgniter:

  • Posssible returning of incorrect URL by abs_url function
  • Possible incorrect value in $url variable

Download updated Curl library for CodeIgniter, v. 1.1.1 (zip, 4kb)

Share and Enjoy:
  • del.icio.us
  • Digg
  • Reddit
  • Ma.gnolia
  • Technorati
  • Propeller
  • Facebook
  • StumbleUpon
  • Furl
  • blogmarks
  • Google
  • E-mail this story to a friend!


April 27, 2008 by Alex Polski | No Comments »

How old is your site?

One of the ways to determine the age of the site is to use Wayback Machine. Just type your site’s URL and find the first record in results.

I wrote the function to automate this operation and included it to my SEO helper for CodeIgniter.

The following example shows how to use it:

$this->load->helper('seo');
$age = domain_age('codeigniter.com');
if ($age !== '-1')
{
  echo "Year: $age[year], month: $age[month], day: $age[day]";
}
else
{
  echo 'No records found!';
}

As you see this is very easy.

Download SEO helper version 1.2 for CodeIgniter

Share and Enjoy:
  • del.icio.us
  • Digg
  • Reddit
  • Ma.gnolia
  • Technorati
  • Propeller
  • Facebook
  • StumbleUpon
  • Furl
  • blogmarks
  • Google
  • E-mail this story to a friend!


April 23, 2008 by Alex Polski | No Comments »

How to check Alexa Rank in PHP

It’s more simpler than you think! Just use my SEO helper for CodeIgniter like in this example:

$this->load->helper('seo');
echo alexarank('alexpolski.com');

Note that SEO helper requires Curl library.

You can download SEO helper 1.1 for CodeIgniter here.

Share and Enjoy:
  • del.icio.us
  • Digg
  • Reddit
  • Ma.gnolia
  • Technorati
  • Propeller
  • Facebook
  • StumbleUpon
  • Furl
  • blogmarks
  • Google
  • E-mail this story to a friend!


April 20, 2008 by Alex Polski | 2 Comments »

Curl library 1.1 for CodeIgniter

I continue to develop Curl library for CodeIgniter and today’s blog post is about the new version. What’s new in this release?

First of all, request and response headers are supported now. You may specify your own request header in http_get and http_post methods:

$headers = array(
  'Authorization: AuthSub token="' . $_POST['token'] . '"',
  'X-Google-Key: key=' . $developerKey,
  'Content-Type: application/atom+xml'
);
$this->curl->http_post($url, $postfields, $headers);

As for response headers, you have an access to them now through the $headers variable:

echo $this->curl->headers;

One more feature that I want to tell you is automatic redirect support. Look at this code:

$this->curl->http_get('http://google.com');

Curl library will parse headers (or use CURLOPT_FOLLOWLOCATION curl option if possible) and automatically redirect to http://www.google.com.

To know what’s the final URL of HTTP GET/POST operation you can use $url variable:

echo $this->curl->url;

If for some reasons you do not want to use automatic redirect feature, use this code:

$this->curl->open(array('follow_location' => false)); // during initialization
// or
$this->curl->follow_location = false;

And the last thing I want to tell is a small bonus: abs_url function which will help you to convert relative URL to absolute one.

$absolute_url = $this->curl->abs_url('../test.html', 'http://example.com/path/to');

Download Curl library 1.1 for CodeIgniter

Share and Enjoy:
  • del.icio.us
  • Digg
  • Reddit
  • Ma.gnolia
  • Technorati
  • Propeller
  • Facebook
  • StumbleUpon
  • Furl
  • blogmarks
  • Google
  • E-mail this story to a friend!

April 15, 2008 by Alex Polski | No Comments »

How to check Google PageRank in PHP

My previous post was about Curl library for CodeIgniter. And now it’s time to tell you a main secret - how we will check Google PageRank in Mass PageRank Checker tool.

As I started development with CodeIgniter, I wrote a little CI-helper for SEO functions and added Google PageRank cheking function. Later I will add other useful functions to this helper.

You can download SEO helper here.

You wanna ask me how I did it? It’s quite simple! I learned the code of seo4firefox addon (it’s javascript) and wrote the same in PHP :-)

To install it you need copy seo_helper.php file to the system/application/helpers folder of your CodeIgniter instance.

And now let’s see the example of using.

$this->load->helper('seo');
$pr = pagerank('http://alexpolski.com/');

It’s more than simply! Enjoy!

Share and Enjoy:
  • del.icio.us
  • Digg
  • Reddit
  • Ma.gnolia
  • Technorati
  • Propeller
  • Facebook
  • StumbleUpon
  • Furl
  • blogmarks
  • Google
  • E-mail this story to a friend!


« Older Entries