I hereby claim:
- I am themattharris on github.
- I am themattharris (https://keybase.io/themattharris) on keybase.
- I have a public key ASBn4FfXf_T-hzDKYTAqyhvqvImlPAOxQ0ywW2jf74yK0Qo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| <?php | |
| $tmhOAuth = new tmhOAuth(array( | |
| 'curl_ssl_verifypeer' => true, | |
| 'curl_ssl_verifyhost' => 2, | |
| 'consumer_key' => 'YOUR_CONSUMER_KEY', | |
| 'consumer_secret' => 'YOUR_CONSUMER_SECRET', | |
| 'user_token' => 'A_USER_TOKEN', | |
| 'user_secret' => 'A_USER_SECRET', | |
| )); |
| $tmhOAuth->request('GET', $tmhOAuth->url('1.1/search/tweets'), array( | |
| 'q' => 'themattharris' | |
| )); |
| <?php | |
| // incase you miss some data. You might need to increment the page number. | |
| // Remember, the max tweets returned by the Twitter API is 3200. | |
| require '../tmhOAuth.php'; | |
| $tmhOAuth = new tmhOAuth(array( | |
| 'consumer_key' => 'YOUR_CONSUMER_KEY', | |
| 'consumer_secret' => 'YOUR_CONSUMER_SECRET', | |
| 'user_token' => 'A_USER_TOKEN', |
| <?php | |
| /** | |
| * This script relies on tmhOAuth, which can be downloaded here: | |
| * https://github.com/themattharris/tmhOAuth | |
| * | |
| * Instructions: | |
| * 1) If you don't have one already, create a Twitter application on | |
| * https://dev.twitter.com/apps | |
| * 2) From the application details page copy the consumer key and consumer |
| <?php | |
| /** | |
| * Calculated the number of weekdays (M-F) between two timestamps (inclusive). | |
| * | |
| * @param string $from the timestamp to start measuring from | |
| * @param string $to the timestamp to stop measuring at | |
| * @param string $normalise whether the time of day should be ignored (forces times to yyyy-mm-ddT00:00:00+00:00) | |
| * @return int the number of weekdays between the two timestamps | |
| * @author Matt Harris | |
| */ |
| # Thanks to Mark McBride for jsonator syntax | |
| function jsoncurl { | |
| curl -s $@ | jsonator | |
| } | |
| function jsontwurl { | |
| twurl $@ | jsonator | |
| } | |
| function obtwurl { | |
| twurl $@ | objenator |
| /** | |
| * ellipse() | |
| * ellipses a string using english language rules | |
| * | |
| * @param string $text The original text string | |
| * @param int $maxlen The maximum length of the string to ellipse (this includes the ellipse characters) | |
| * @param string $ellip The string to use as the ellipsis | |
| * @param bool $towords Whether to ellipse to word boundaries or not | |
| */ | |
| function ellipse($text, $maxlen, $ellip='...', $towords=TRUE) { |
| /** | |
| * makeSalt() | |
| * generates a random salt up to the requested length | |
| * | |
| * @param int $length Length of salt to produce | |
| */ | |
| function makeSalt($length=45) { | |
| $sequence = array_merge(range(0,9), range('A','Z'), range('a','z'), range('!','.')); | |
| // remove unsafe characters | |
| $unsafe = array('"',"'"); |
| <?php | |
| /* | |
| Flickr Caching Script for WordPress | |
| Description: Provides a local caching system for Flickr images to ensure they | |
| are viewable when clients have Flickr blocked. | |
| Version: 1.0 | |
| Author: Matt Harris | |
| Author URI: http://themattharris.com | |
| License: MIT (http://www.opensource.org/licenses/mit-license.php) |