Skip to content

Instantly share code, notes, and snippets.

View CircleSquaredPublishing's full-sized avatar

Circle Squared Publishing CircleSquaredPublishing

View GitHub Profile
@CircleSquaredPublishing
CircleSquaredPublishing / footer.php
Created August 18, 2017 23:00
Display the Facebook Review Markup.
@CircleSquaredPublishing
CircleSquaredPublishing / wp-config.php
Created August 18, 2017 22:57
Define the Facebook App Tokens.
<?php
/** The app token for the Circle Squared Publishing Facebook app. */
define( 'CIRCLE_SQUARED_APP_TOKEN', 'access_token={app-id}|{app-secret}');
?>
@CircleSquaredPublishing
CircleSquaredPublishing / functions.php
Last active August 18, 2017 22:55
PHP function for retrieving total review count from a Facebook page.
function get_facebook_review_count() {
// Build the URL that will call the Facebook API endpoint that contains the
// total number of reviews for our page.
$url = 'https://graph.facebook.com/v2.10/';
$url .= 'CircleSquaredPublishing';
$url .= '?fields=rating_count&';
// The app token is defined as a PHP constant in the wp-config.php file. This
// is a best practice for security purposes.
$url .= CIRCLE_SQUARED_APP_TOKEN;
// Use PHP's built is CURL library to send a request to the URL created above.
@CircleSquaredPublishing
CircleSquaredPublishing / Facebook API Call Using PHP
Created June 14, 2017 20:07
Code snippet from a tutorial on willconkwright.com about how to gather public data using the Facebook Graph API and PHP.
<?php
/**
* @category Tutorials
* @version 1.0 [June 14, 2017]
* @author Will Conkwright
* @copyright Copyright (c) 2017 Circle Squared Publishing, LLC
* A custom function for getting public data from the Facebook Graph API
*/
@CircleSquaredPublishing
CircleSquaredPublishing / schema_header.php
Created May 24, 2017 16:38
Insert meta data from Wordpress Post into header.php
<?php
$schema = get_post_meta( get_the_ID(), 'schema', true );
if( !empty( $schema ) ) {
echo $schema;
}
?>
@CircleSquaredPublishing
CircleSquaredPublishing / birdman-endurance-keith-bruno.json
Created May 24, 2017 16:35
Schema.org Markup for Endurance Seafood Blog Post
<script type="application/ld+json"> {
"@context": "http://schema.org/",
"@type" : "BlogPosting",
"keywords" : "Endurance Seafood, Commercial Fishing, Bird Man, Keith Bruno, Neuse River, Oriental, North Carolina, Flounder, Seafood",
"author" : {
"@type" : "Organization",
"name" : "The Pamlico News"
},
"creator" : {
"@type" : "Organization",
@CircleSquaredPublishing
CircleSquaredPublishing / style.css
Created April 19, 2017 04:21
Stylesheet for the page contents.
/**
* @project Heatery
* @version 2.0
* @author Will Conkwright
* @copyright 2017 Circle Squared Publishing, LLC
* @cssdoc version 1.0-pre
* @license GPL v3
*
*/
@CircleSquaredPublishing
CircleSquaredPublishing / functions.php
Created April 19, 2017 04:19
Server side script that collects, stores and delivers results from call to the Facebook API.
<?php
/**
* @package Heatery
* @version 2.0 [April 18, 2017]
* @author Will Conkwright
* @copyright Copyright (c) 2017 Circle Squared Publishing, LLC
* @license Licensed MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@CircleSquaredPublishing
CircleSquaredPublishing / ajax.js
Created April 19, 2017 04:14
Ajax call to the results from PHP script.
/**
* @package Heatery
* @version 2.0 [April 18, 2017]
* @author Will Conkwright
* @copyright Copyright (c) 2017 Circle Squared Publishing, LLC
* @license Licensed MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
@CircleSquaredPublishing
CircleSquaredPublishing / fb_collect.sql
Created October 3, 2015 18:24
Facebook Graph API Table Syntax
# ************************************************************
# Sequel Pro SQL dump
# Version 4499
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: localhost (MySQL 5.5.42)
# Database: tutorials
# Generation Time: 2015-10-03 18:22:57 +0000