This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// http://pmg.co | |
class wpDlvrit | |
{ | |
protected $key; | |
function __construct( $key = false ) | |
{ | |
$this->set_key( $key ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from BeautifulSoup import BeautifulSoup as Soup | |
from urllib2 import urlopen | |
def get_product_links(url): | |
try: | |
content = urlopen(url).read() | |
except: | |
return False | |
soup = Soup(content) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Add Extra Comment Fields | |
Plugin URI: http://pmg.co/category/wordpress | |
Description: An example of how to add, save and edit extra comment fields in WordPress | |
Version: n/a | |
Author: Christopher Davis | |
Author URI: http://pmg.co/people/chris | |
License: MIT | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> | |
<script type="text/javascript"> | |
jQuery(document).ready(function(){ | |
jQuery('ul.tab-nav li').click(function(e){ | |
var tab_id = jQuery(this).attr('id'); | |
jQuery('ul.tab-nav li').removeClass('active'); | |
$(this).addClass('active'); | |
jQuery('.tab-container div.tab').hide(); | |
jQuery('.tab-container div#' + tab_id + '-tab').show(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Reminder Emails | |
Plugin URI: http://www.christopherguitar.net/ | |
Description: Sends a reminder email if you haven't posted in seven days. | |
Version: n/a | |
Author: Christopher Davis | |
Author URI: http://www.christopherguitar.net | |
License: GPL2, Creative Commons | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Custom-Post-Type Base | |
Plugin URI: http://pmg.co/ | |
Description: Dynamically change your custom post type slugs | |
Version: n/a | |
Author: Christopher Davis | |
Author URI: http://pmg.co/people/chris | |
License: GPL2/Creative Commons | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: PMG Widget Tututorial | |
Plugin URI: http://pmg.co/category/wordpress | |
Description: How to create WordPress Widgets. | |
Version: 1.0 | |
Author: Christopher Davis | |
Author URI: http://pmg.co/people/chris | |
License: GPL2 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from BeautifulSoup import BeautifulSoup as Soup | |
def get_products(url): | |
r = requests.get(url) | |
if 200 != r.status_code: | |
return False | |
s = Soup(r.content) | |
products = s.findAll('li', {'class': 'item'}) | |
out = [] |