Posts Tagged script

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 (659)

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


  

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)

 

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