The popular open-source contract for web designers and developers by Stuff & Nonsense
- Originally published: 23/12/2008
- Revised date: 15/12/2013
- Original post
| <?php | |
| class WP_REST_Posts_Controller_StringTerms extends WP_REST_Posts_Controller { | |
| /** | |
| * Retrieves the post's schema, conforming to JSON Schema. | |
| * | |
| * @return array Item schema data. | |
| */ | |
| public function get_item_schema() { |
| var requestjson = require('request-json'); | |
| var request = require('request'); | |
| var PushBullet = require('pushbullet'); | |
| var pusher = new PushBullet('PUSHBULLET_API_KEY'); | |
| var cheerio = require('cheerio'); | |
| var stores = [ | |
| {name:"The Pi Hut",url:'http://thepihut.com/products/raspberry-pi-zero',in_stock:check_pihut_inventory | |
| }, | |
| {name:"Adafruit",url:'https://www.adafruit.com/products/2816',in_stock:check_adafruit_inventory |
| //Requires node-notifier for desktop notification | |
| path = "products/raspberry-pi-zero.js" | |
| request = require('request-json'); | |
| var client = request.createClient("http://thepihut.com/"); | |
| function check_availability() { | |
| client.get(path, function(err, res, body) { |
| <?php | |
| if(is_archive()) { | |
| function rel_next_prev(){ | |
| global $paged; | |
| if ( get_previous_posts_link() ) { ?> | |
| <link rel="prev" href="<?php echo get_pagenum_link( $paged - 1 ); ?>" /><?php | |
| } | |
| if ( get_next_posts_link() ) { ?> |
| //This function tracks a google analytics event regaurdless if using UA or classic trackin code | |
| /** | |
| * Tracks a GA event using either Classic or Universal Analytics. | |
| * @param {[String or Object]} categoryorobject [Either Event Category, or an object containing all parameters] | |
| * @param {[String]} action [The Event Action] | |
| * @param {[String]} label [The Event Lable] | |
| * @param {[String]} value [The Event Value] | |
| */ | |
| function trackEvent(categoryorobject, action, label, value) { | |
| if(typeof(ga) == "function") { |