Archive

Archive for August, 2009

Needed a random timed cron; Got it

August 18th, 2009 1 comment

Sorry this is nothing related to php, though I wanted to run a cron job or scheduled job at a random time, searching the Internet gave me lots of ideas but I found the apt solution only yesterday.
Read more…

Categories: Tips, Uncategorized Tags: ,

Using TagTheNet to generate tags on WordPress

August 15th, 2009 No comments

Recently on Kerala News by Asianet, though the wp-simple-tags was there, the posts were not being tagged automatically. And on a detailed check I found it was due to a misconfiguration, and once the same was done properly the tagging started smoothly. But already a set of 8K posts were there with no or unrelated tags mistakes and un awareness of the operators who were posting to the site. Now I wanted these to be tagged properly.
I had already used the word-twit plugin and done some mods to the same, so it was more eaiser for me. Just went through the original code of word-twit and salvaged a small script which is attached here with as download.
require_once( dirname(__FILE__) . '/wp-load.php' );
The code above loads the wordpress system and initializes the wp variables and connects to the database.
global $wpdb;
Makesure we have the database abstraction object from wordpress, to select the posts, and do all the required manipulations on the same.
require_once( ABSPATH 'wp-includes/class-snoopy.php' );
Include the inbuilt snoopy class, to mimic a web browser with the most simplicity.
Read more…

WordPress Super Cache on lighttpd

August 2nd, 2009 1 comment

While trying to speed up Select Articles, I got stuck, torn in between WP Super Cache and lighttpd. Already we at Saturn are using lighttpd on several dedicated servers, and know the potential and benefit of having this over Apache though the flexiblity of having a perdirectory configuration at the programmers choice was a big question. A quick search on the Google landed me to a technical blog, notepad and personal web page by Asterios Katsifodimos.

Trying to get WP Super Cache & WordPress working on my fast lighttpd server, I came into problems, mainly because of lighttpd’s lack of (Apache’s version of) the mod_rewrite module. The static files that were created from the cache were not statically served from wordpress. The problem is that in order to use them, the PHP fcgi was called for each request. So, why would we have to call PHP every time that a file can be completely statically provided by the web server?

Read the rest of his version Installing WP Super Cache with lighttpd