Skip to content

Instantly share code, notes, and snippets.

View lbernstein's full-sized avatar

Larry Bernstein lbernstein

View GitHub Profile
<!-- Demandbase Domain API. -->
<script type="text/javascript"
src="http://api.demandbase.com/api/v1/domain.json?key=<your_demandbase_key>&query=apple.com&callback=<your_callback>">
</script>
var myCallback = function(data) {
// Check if not an ISP
if (!data.isp) {
// Check if detailed company data is available
if (data.information_level == ‘detailed’) {
// All company firmographic fields are available for use
// Take some action based on these details, which may include Account Watch
company = data.company_name
var myCallback = function(data) {
// Determine if the visitor is identified as an ISP
if (data.isp) {
// Determine if detailed company information is available
if (data.information_level == ‘detailed’) {
// All firmographic fields are available for use
// Take some action based on these details
company = data.company_name
industry = data.industry
scriptNode = document.createElement('script');
scriptNode.src = dapi+"/api/v2/ip.json?key=<Your_Demandbase_Key>&callback=demandbase_parse";
scriptNode.type = 'text/javascript';
document.body.appendChild(scriptNode);
<style>
#demandbase-autocomplete #demandbase-company-autocomplete-widget .ui-widget {
background-color: white;
border-color: black;
border-style: solid;
border-width: 1px;
display: block;
left: 199px;
position: relative;
<style>
#demandbase-autocomplete { font-size: 11pt; }
</style>
Demandbase.CompanyAutocomplete.widget({
company: "company",
email: "email",
label: function($,pick){
var addr = pick.street_address;
// If addr doesn’t exist then use default template
if (addr == null) return "{marketing_alias} ({city}, {state})";
addr = addr.substring(0, Math.min(10,addr.length+3)).replace(/\s+$/g,'');
Demandbase.CompanyAutocomplete.widget({
company: "company",
email: "email",
label: "{marketing_alias} ({city}, {state} {zip})", // Add zip code to the display
key: <Your_Demandbase_Key>,
callback: callback
});
Demandbase.CompanyAutocomplete.widget({
company: "company",
email: "email",
dataType: "json",
key: <Your_Demandbase_Key>,
callback: callback
});
input_match: Object
annual_sales: 2147483647
city: "San Jose"
company_name: "Cisco Systems"
country: "US"