PHP

Writing Twitter Bot, the “intellectual one”, in php

What is Twitter? For many it is a place to brag about everyday life events and post pictures. Some use it to promote themselves, corporations and alikes try to provide "customer service" using Twitter and other folks are doing all sorts of things from selling knock-offs to completely illegal stuff.

This article is about how you can use Twitter to promote a site, service or anything you'd like to the tweeps.

It is apparent, that searching for a keyword or a key phrase and responding to all of those would take a lot of time, so we are going to use automated scrip (a twitter [ro]bot), which will do all the job for us.

› Continue reading

Tags: ,

Friday, January 27th, 2012 Hacks, PHP, Thoughts No Comments

Make your LEMP website faster by installing eAccelerator

The other day i had a discussion with someone about how fast Java-powered website are, because the code is compiled and serving a page takes a breeze. The point of discussion was me writing code using php, which is a scripting language and compiles code on-the-fly every time you make a request to the website.

So i decided to take a little experiment involving current LEMP (php-fpm/mySQL Linode VPS host) setup for the client's WordPress blog and add eAccelerator to it.

› Continue reading

Tags: , , ,

Tuesday, February 8th, 2011 Hosting, PHP 1 Comment

Output specific post from a category in WordPress

Let's say you slice a website and need a nicely looking block in a sidebar with one recent post from certain category. Like in case with this one below: Daily Style Quote.

Logically following you need to run "the loop" and ask WordPress for just one post from just this particular category.

Here we go:

 
<div id="dailyStyleQuote">
<div id="quoteText">
      <?php query_posts('category_name=Daily Style Quote&posts_per_page=1'); ?>
      <?php while (have_posts()) : the_post();
  			the_content('');
		?>
        </div>
<div id="quoteBottom">
			<?php the_time('l, F j, Y'); ?>
<?php
		$category_id = get_cat_ID( 'Daily Style Quote' );
    		$category_link = get_category_link( $category_id );
?>
            <a href="<?php echo $category_link; ?>">archive</a>
		</div>
 
        <?php endwhile; ?>
    </div>
 

Tags: , ,

Monday, May 3rd, 2010 PHP, Web Design No Comments

Page permalinks in WordPress

Got myself puzzled for a bit while slicing a WordPress theme this weekend on how to get a permalink to a certain page in WordPress template, given that you know what's page title. Use this:

 
<?php echo get_permalink(get_page_by_title("Page title here")->ID); ?>
 

So now in your template you can use like this:

 
<a href="<?php echo get_permalink(get_page_by_title("About")->ID); ?>">About</a>
 

Tags: , ,

Monday, May 3rd, 2010 PHP, Web Design No Comments

Zip a folder on the server with php

zip icon

I have a spent a day today figuring how to zip a client's web site folder on a Godaddy shared Linux hosting today (they made sure users don't have SSH access on those) in order to transfer it to another server. Apparently, given the limitations of the account setup the best way was to write a php script by executing which i would zip the given folder contents, so that then i could copy just one file and unzip it on the target server.

And it can't be easier than that - if you have a folder, which contains a number of other folders and files in them the script below lets you add to the zip file quickly and easily:

› Continue reading

Tags: , ,

Friday, January 16th, 2009 Hacks, Hosting, PHP 14 Comments

About


Oleksiy Deverishchev is a freelance web developer living in New York City. In this blog he shares his experience with various gadgets and web technologies.

He is available for the following gigs:
  • Microsoft Access projects
  • website design and re-design services
  • php/MySQL developement
  • Java and Grails development
  • virtual private server (VPS) migration, setup and tune-up

For more information and hiring availability please send an email to alex@webandblog.com

Advertisment

Read more

Recent works / current clients

  • BellatAuto Inc - New York / New Jersey used car auto dealer: design and coding.
  • Colette Maison Lumiere - multimedia artist: design and coding for the CMS.
  • Complete Body & Spa - New York City personal training and gym management company: Wordpress template coding.
  • DaleStyle Blog Dale Sudakoff’s fashion blog: Wordpress template coding.
  • DoctorKalitenko.COM - Sergey Kalitenko : antiaging hollistic doctor performing bioidentical replacement therapy. CMS coding and design.
  • Great Jones Spa - premiere New York City Day Spa: coded and designed website and storefront

I am a Freelancers Union Member

Freelancers Union Member Badge