Skip to content

Instantly share code, notes, and snippets.

@swooningfish
swooningfish / 1_Instructions.md
Created November 22, 2012 23:34 — forked from Daniel15/1_Twitter autoresponder bot.md
Twitter autoresponder bot

Twitter autoresponder bot

By Daniel15 (dan.cx) This is a very simple Twitter autoresponder bot. It requires PECL OAuth extension to be installed (run "pecl install oauth", or if on Windows, grab php-oauth.dll. If using cPanel you can install it via WHM). The authentication is designed for command-line usage, it won't work too well via a web browser. You'll have to sign up for an application on Twitter's site to get the consumer key and secret.

Could be modified to be more advanced (match regular expressions to answer questions, etc.)

<?php
// STEP 1: read POST data
// Reading POSTed data directly from $_POST causes serialization issues with array data in the POST.
// Instead, read raw POST data from the input stream.
$raw_post_data = file_get_contents('php://input');
$raw_post_array = explode('&', $raw_post_data);
$myPost = array();
foreach ($raw_post_array as $keyval) {
@narkisr
narkisr / 8192cu-wifi
Created July 20, 2012 20:49
8192cu Wifi on your pie
See http://www.raspberrypi.org/phpBB3/viewtopic.php?t=6256 this desribes how to setup wifi for 8192cu based adapters,
Note that following http://elinux.org/RPi_edimax_EW-7811Un, looks like the above script does thing differently,
The /etc/network/interfaces:
iface wlan0 inet dhcp
wpa-ssid "ssid"
wpa-psk "password"
@jrothmanshore
jrothmanshore / ip_lookup.ps1
Created May 10, 2012 21:25
Powershell script for performing reverse lookups of IP Addresses
$stop = $args.Count
$inputIP = ""
$inputFile = ""
$knownIPFile = ""
$showUsage = 0
$verbose = 0
for ($i = 0; $i -lt $stop; $i++)
{
if ($args[$i] -eq "-f") {
if ( ($i + 1) -eq $stop) {
@smgladkovskiy
smgladkovskiy / .gitignore
Last active September 26, 2015 07:48
Kohana .gitignore
Thumb.bd
.DS_Store
.svn
.htaccess
*.log
*~
*.swp
*.mwb
*.bak
Icon?
@gaker
gaker / .htaccess
Created March 31, 2011 06:41
expires .htaccess
ExpiresActive On
ExpiresByType text/html "access plus 1 second"
ExpiresByType text/css "access plus 1 week"
ExpiresByType image/gif "access plus 1 week"
ExpiresByType image/png "access plus 1 week"
ExpiresByType image/jpg "access plus 1 week"
ExpiresByType image/jpeg "access plus 1 week"
ExpiresByType text/javascript "access plus 1 week"
ExpiresByType application/pdf "access plus 1 week"
ExpiresByType application/x-download "access plus 1 week"
@petemcw
petemcw / my.cnf
Created February 25, 2011 20:11
Ubuntu MySQL 5.1 Configuration - 4GB RAM, Heavy InnoDB
# The MySQL database server configuration file.
#
# DESC: InnoDB mainly, heavy queries, fewer connections, 4GB RAM
#
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
@Daniel15
Daniel15 / 1_Twitter autoresponder bot.md
Last active November 5, 2025 12:06
Twitter autoresponder bot

Twitter autoresponder bot

By Daniel15 (dan.cx) This is a very simple Twitter autoresponder bot. It requires PECL OAuth extension to be installed (run "pecl install oauth", or if on Windows, grab php-oauth.dll. If using cPanel you can install it via WHM). The authentication is designed for command-line usage, it won't work too well via a web browser. You'll have to sign up for an application on Twitter's site to get the consumer key and secret.

Could be modified to be more advanced (match regular expressions to answer questions, etc.)

Questions? See my blog post - http://dan.cx/blog/2011/06/twitter-autoreply-bot-dbznappa

Modified 2013-06-13 - Twitter API 1.0 discontinued, modified to use Twitter API 1.1