Skip to content

Instantly share code, notes, and snippets.

View adrianmott's full-sized avatar

Adrian Mott adrianmott

View GitHub Profile
@adrianmott
adrianmott / hubspot_gtw_double_post.aspx
Created February 6, 2012 20:01
HubSpot GoToWebinar Double Post from a form (not a HS landing page)
System.Text.StringBuilder GTWoutput = new System.Text.StringBuilder();
//GTW form elements
GTWoutput.Append("WebinarKey=" + Server.UrlEncode(Request.QueryString["WebinarKey"].ToString()));
GTWoutput.Append("&Form=webinarRegistrationForm");
GTWoutput.Append("&Name_First=" + Server.UrlEncode(Request.QueryString["FirstName"].ToString()));
GTWoutput.Append("&Name_Last=" + Server.UrlEncode(Request.QueryString["LastName"].ToString()));
GTWoutput.Append("&Email=" + Server.UrlEncode(Request.QueryString["Email"].ToString()));
//get POST URL for GTW
@adrianmott
adrianmott / hubspot_gtw_double_post.php
Created February 6, 2012 19:58
HubSpot GoToWebinar Double Post from a form (not a HS landing page)
<?php
if ($_SERVER['REQUEST_METHOD'] == "GET") {
header('Location:http://thefreshdish.com');
$gtwPost = "";
//Create string for GoToWebinar from same form POST data
$gtwPost = "WebinarKey=" . urlencode($_GET['WebinarKey'])
. "&Form=" . urlencode($_GET['Form'])
. "&Name_First=" . urlencode($_GET['firstName'])
@adrianmott
adrianmott / hubspot_highrise.php
Created February 6, 2012 19:54
HubSpot to Highrise CRM Integration Code Sample
<?php
//First, we start by opening the log file and getting the last time this file ran.
$logfile = "hubspotLeadTime.log"; //Make sure you have the correct permissions on these log files on your server.
$leadlog = "hubspotLeadLog.log";
$apikey = "XXXXXXXXXX"; //replace this with your own key
if (file_exists($logfile)) { //Proceed like normal
$fileh = fopen($logfile, 'r') or die("can't open file");
@adrianmott
adrianmott / hubspot_config.php
Created February 6, 2012 19:14
HubSpot to SugarCRM Integration Code Sample
<?php
$hubspot_config = array (
'hsportalid' => '######',
'hapikey' => 'XXXXXX',
'hapiuser' => 'XXXXXX',
'hapipassword' => 'XXXXXX',
'sugarinstallpath' => 'http://somesite.com/sugarcrm/',
'hapilogfile' => './sycnlog.txt');
?>