Posts Tagged php

Tweet My Script Plugin for WordPress

Posted by Matt Kendrick on Tuesday, 26 January, 2010

About: This plugin watches your Twitter RSS Feed for user-defined “launch codes” to trigger user-defined script URLs.

Have you ever needed a script or task run on your blog and you were not near a computer with internet access? Well look no further than “Tweet My Script.” This plugin allows you to simply use your cell-phone to text a short tweet to Twitter with a “launch code.” When someone accesses your Word Press blog, Tweet My Script will check to see if you’ve left any new launch codes to activate. After each successful launch, the plugin records the previous tweet. This insures that the script being launched will only be launched once, unless the launch code is used again in a new tweet. This plugin can be used to launch any public accessible script.

Tweet My Script Screenshot

Updates

Version 0.75 – March 7th 2010: Offset feature added. Allows for bloggers to set an offset on the number of times your blog checks Twitter to keep from exceeding API limits. This is ideal for blogs with high traffic or blogs hosted on high traffic shared hosting. Default offset is set to 0.

Installation

1. Upload `tweet_my_script.php` and `tweet_my_script_options.php` to the `/wp-content/plugins/` directory

2. Activate the plugin through the ‘Plugins’ menu in WordPress

3. Configure plugin settings from the dashboard settings option `Tweet My Script`

Download

Tweet My Script WordPress Plugin (663)

This is my first official plugin for WordPress! If you find it helpful or would like to help further push development, please donate!


  

PHP 3 Band Resistor Calculator Project

Posted by Matt Kendrick on Saturday, 29 August, 2009

300 in 1A few weeks ago, our friends Catie and David gave us an electronic lab kit (about to get rid of it in a yard sale). The kit came with instructions and parts to build over 300 different electronics projects. We were ecstatic. Heather and I have been looking for something like this for some time. As a kid I had basic kits like the one we received. However they were much simpler. We ripped through the packaging and started playing around with some of the projects.

It took us a little while to put something together. One of the problems we kept running into was decoding the resistor values. Granted the theory is very simple. But it takes some time to get use to. We found some resistor calculators online. Most of them got the job done. The calculators we found, you submit the resistor codes and it returns the value of the resistor.

Since the instructions tell you the resistor value, it would be much easier to enter the value and get the resistor color codes. Then a light went off. Being a web application coding geek, I deiced to build my own calculator. That night I finished the basic functionality of the calculator. At that point the application allowed you to submit what the color bands are on the resistor. Then the script would reload the page with the resistance value.

This morning I finished the project by building the reverse method of calculating resistor color codes. Now you can enter the resistor value, and it returns the color bands in the order they appear on the resistor. Pretty easy huh? I used a pure PHP script (no java script, no ajax) on this project. I wanted a server side only approach. It wasn’t the easiest thing I’ve ever written. But I had fun doing it. You can check it out using the link below.

http://mattkendrick.com/projects/resistor.php

Random Quote Generator

Posted by Matt Kendrick on Thursday, 27 August, 2009

Here’s a quick script I wrote to display random quotes.


<?php

//Random Quotes Script
//Matt Kendrick – Aug. 2009
//mattkendrick.com

//Displays random quotes from a MySQL Table

//database server
$db_server = “localhost”;

//database user
$db_user = “user”;

//database password
$db_pass = “password”;

//database name
$database = “quote_db”;

//connect to database
mysql_connect($db_server,$db_user,$db_pass);

//select database
mysql_select_db($database);

//query database for random quote
$sql = “SELECT quote_text,author FROM quotes ORDER BY RAND() LIMIT 1″;
$result = mysql_query($sql);

while($row = mysql_fetch_array($result,MYSQL_NUM))
{

//display result – format however you like
echo “<i>’$row[0]‘</i> – <b>$row[1]</b>”;

}

//close database connection
mysql_close();

?>

Below is the table structure needed.


– Table structure for table `quotes`

CREATE TABLE IF NOT EXISTS `quotes` (
`quote_id` int(11) NOT NULL auto_increment,
`quote_text` text NOT NULL,
`author` varchar(50) NOT NULL,
PRIMARY KEY (`quote_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;


– Dumping data for table `quotes`

INSERT INTO `quotes` (`quote_id`, `quote_text`, `author`) VALUES
(1, ‘I think it’’s fair to say that personal computers have become the most empowering tool we”ve ever created. They”re tools of communication, they”re tools of creativity, and they can be shaped by their user.’, ‘Bill Gates’),
(2, ‘Never trust a computer you can”t throw out a window.’, ‘Steve Wozniak’),
(3, ‘The Internet is not just one thing, it’’s a collection of things – of numerous communications networks that all speak the same digital language. ‘, ‘Jim Clark’),
(4, ‘What do we want our kids to do? Sweep up around Japanese computers?’, ‘Walter F. Mondale’);

You can download the complete script and database table here: Random Quote Generator (175)

Get ASCII’d

Posted by Matt Kendrick on Tuesday, 18 August, 2009

I’m sure you’ve ran into ASCII art before and never knew what it was called. Remember the last time someone messaged you and typed a colon and a right parenthesis. “:)” Well that’s an example of ASCII art. Basically ASCII art is artwork created with text characters (letters, numbers and symbols). Since the age of typewriters people have been “drawing” with ASCII characters!

What got me thinking about ASCII artwork today, was a neat PHP script called ASCIIArtist. The script allows you to convert bitmap images (jpg,png,gif) to ASCII characters. The script was written by Sebastian Röbke (Boosty) of Meerbeck Germary.

The script is very simple to use. Just visit Sebastian’s site and input the URL of the picture you’re wanting to convert to text. Then change the settings as you like and press “Render”. Then you’ll see a new window pop up with the ASCII artwork version of your image!

You can check the results of our conversion of one of our wedding photos here. Don’t forget to check out Sebastian’s site and get ASCII’d!

w3Schools.com

Posted by Matt Kendrick on Thursday, 30 July, 2009

w3schools LogoWant to learn how to do HTML? Ever needed a quick reference while writing a PHP script? We’ll look no further than w3schools.com! This site is full of great tutorials and references for all your web programming needs. In 1998 a team of developers quit their jobs to form a company called Refsnes Data. They vowed never to charge for the information available on their website. All hosting costs and tutorial are completely supported by their sponsors.

The tutorials are easy to understand. They offered plenty of examples to follow. You can test their examples using their live “Try It Yourself” demos. You can learn at your own pace in the comfort of your office or home. If you’re still a little fuzzy on something. Feel free to sign up and use their forums. There are no stupid questions.

I’ve been using w3Schools.com for years. One of my professors in college first told me about. Ever since I’ve been going back for more information.

PHP Scripts: Big Dump

Posted by Matt Kendrick on Thursday, 30 April, 2009

Today’s post is kinda short. Thought I’d tell ya about a neat tool I used today.

Ever needed to do a large MySQL import, but your host doesn’t allow big uploads/imports through phpMyAdmin? Or have you performed an import and have it timeout half way through? Well not anymore thanks to a handy php script call BigDump. The tool that allows you to do large imports through your browser.

To run the script,  upload bigdump.php to your site. Then you’ll need to edit that file to configure a database connection. Once that is set, you can either upload through BigDump’s interface (25 meg limit) or point it to a  file on your site. BigDump will list the uploaded dump files, just click “start import” and the script will start importing your dump. It’s able to avoid the limitations of hosting companies through staggering. Basically it only performs a small part of the import at a time and then reloads the script to get the next little bit. Please remember to delete the script when you’re done. Or anyone can run queries on your database.

There ya have it, a cool tool with a funny name!

http://www.ozerov.de/bigdump.php

 

You need to log in to vote

The blog owner requires users to be logged in to be able to vote for this post.

Alternatively, if you do not have an account yet you can create one here.

Powered by Vote It Up