Skip to content

Instantly share code, notes, and snippets.

@azcoov
azcoov / widget.js
Created December 27, 2013 21:54 — forked from lukencode/widget.js
(function () {
var scriptName = "embed.js"; //name of this script, used to get reference to own tag
var jQuery; //noconflict reference to jquery
var jqueryPath = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js";
var jqueryVersion = "1.8.3";
var scriptTag; //reference to the html script tag
/******** Get reference to self (scriptTag) *********/
var allScripts = document.getElementsByTagName('script');
@azcoov
azcoov / 1 response.js
Last active December 31, 2015 03:58
Nearby Now Review Request API
{
"obj": "reviewrequest",
"success": true,
"id": "947351D0-9CC0-45F7-A5A9-509DA58FBADF",
"createdAt": 1423073174
}
@azcoov
azcoov / nearbyreviews.rb
Last active December 9, 2016 00:39
Example of calling the Nearby Now API with Ruby using the rest-client gem. View the API Integration page for more examples: http://servicepros.nearbynow.co/plugins/api-integration/
require 'rest-client'
#resource = 'https://api.sidebox.com/plugin/nearbyreviews'
resource = 'https://api.sidebox.com/plugin/servicearea'
html = RestClient.get resource, {
:params => {
'storefronttoken' => '{client_api_token}',
'state' => 'AZ',
'city' => 'Phoenix',
'count' => 20
@azcoov
azcoov / heatmap.cs
Last active October 11, 2023 21:52
Example of calling the Nearby Now API with C#. View the API Integration page for more examples: http://servicepros.nearbynow.co/plugins/api-integration/
public class ApiSampleController : Controller
{
private const string api =
"https://api.sidebox.com/plugin/heatmap?storefronttoken={0}&state={1}&city={2}&zoomlevel={3}&showmap={4}&techemail={5}&mapscrollwheel={6}&agent={7}&checkincount={8}&reviewcount={9}";
private const string StorefrontToken = "get this from the Nearby Now admin site";
public ActionResult NearbyNowReviews(String State, String City)
{
var agent = Request.UserAgent;
var wc = new WebClient();
@azcoov
azcoov / _params.php
Last active June 6, 2023 20:22
Example of calling the Nearby Now Content Display API with PHP. View the "Content Display API for Site Integration" page in the knowledge base for more examples.
<?php
//Base endpoint for all API calls
$endpoint = "https://api.sidebox.com/plugin";
//The resouce is the API Endpoint you'll be making a web request to
$resource = "/heatmap";
//$resource = "/nationwideserviceareareviewcombo";
//$resource = "/testimonials";
//$resource = "/photogallery";
//$resource = "/googlereviews";
@azcoov
azcoov / nn_combo_plugin_responsive.css
Last active December 28, 2015 12:39
Example of how to make the NN Combo Plugin responsive
@media only screen and (max-device-width : 480px) {
.nn-review-outer-cont {
font-size:180% !important;
/* Your mileage may vary depending on your website font */
}
.nn-combo-left {
width:100% !important;
}
.nn-combo-right {
width:100% !important;
{
"event": "subscriber.subscribed",
"data": {
"object": {
"id": 99999,
"email": "foo@bar.com",
"fields": {
"first_name": "John",
"last_name": "Doe"
},
@azcoov
azcoov / plugin.php
Created August 29, 2013 16:06
Example of the current Nearby Now WordPress Plugin
<?php
/*
Plugin Name: Nearby Now Reviews and Audio Testimonials
Plugin URI: http://servicepros.nearbynow.co/plugins/wordpress-plugins/
Description: Nearby Now - Recent Reviews, Service Area Plugin and Audio Testimonials.
Version: 1.3.0
Author: Nearby Now
Author URI: http://www.nearbynow.co
*/
#!/bin/sh
# Licence: MIT
# Created by tomykaira, 2011-10-25
if [ $# -ne 1 ]; then
echo "Give me your new project name (only)"
exit 1
fi
def update_ducksboard
api_key = ""
api_secret = ""
url = "https://#{api_key}:#{api_secret}@api.preact.io/api/v2/insights/health"
data = RestClient.get "#{url}", :content_type => :json, :accept => :json
accounts = data["accounts"]
# boxes
push_duck("YOUR_DATAPOINT_ID", accounts["good"]) # good account health