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 marketorestpython.client import MarketoClient | |
BATCH_ID = 3274 | |
MUNCHKIN_ID = 'xxx-xxx-xxx' | |
CLIENT_ID = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' | |
CLIENT_SECRET = 'xxxxxxxxxxxxxx' | |
mc = MarketoClient(MUNCHKIN_ID, CLIENT_ID, CLIENT_SECRET) | |
failed_leads = mc.execute(method='get_import_failure_file', id=BATCH_ID) | |
file_name = "import-failure-for-batch-" + str(BATCH_ID) + ".csv" |
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
<table width="100%" border="0" cellspacing="0" cellpadding="0"> | |
<tbody align="center"> | |
<tr> | |
<td> | |
<table border="0" cellspacing="0" cellpadding="0"> | |
<tbody> | |
<tr> | |
<td align="center" bgcolor="#1273fa"><a href="{{my.pro_pilot_landing_page}}" target="_blank" style="font-size: 14px; font-family: Helvetica, Arial, sans-serif; color: #ffffff; text-decoration: none; border-radius: 3px; padding: 12px 18px; display: inline-block;">Let's launch your pilot</a></td> | |
</tr> | |
</tbody> |
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 utils import SalesforceUtility | |
username = 'joe.fusaro@ivanti.com' | |
password = 'myPassword' | |
token = 'mySecurityToken' | |
if __name__ == "__main__": | |
sfdc = SalesforceUtility(username, password, token) | |
client = sfdc.connection |
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
AFGHANISTAN | |
ALBANIA | |
ALGERIA | |
AMERICAN SAMOA | |
ANDORRA | |
ANGOLA | |
ANGUILLA | |
ANTARCTICA | |
ANTIGUA AND BARBUDA | |
ARGENTINA |
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
<HTMLQuestion xmlns="http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2011-11-11/HTMLQuestion.xsd"> | |
<HTMLContent><![CDATA[ | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/> | |
<script type='text/javascript' src='https://s3.amazonaws.com/mturk-public/externalHIT_v1.js'></script> | |
</head> | |
<body> | |
<form name='mturk_form' method='post' id='mturk_form' action='https://www.mturk.com/mturk/externalSubmit'> |
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 integrations.utils import convert_str | |
from integrations.salesforce.soap import SalesforceMergeManager | |
from integrations.salesforce.settings import SALESFORCE_FIELDS_TO_IGNORE | |
record_type_mapper = { | |
'SALESFORCE':SalesforceMergeManager | |
} | |
field_names_to_ignore = { |
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 React from 'react'; | |
class ChangeList extends React.Component { | |
constructor() { | |
super(); | |
this.state={items:[]}; | |
} | |
componentDidMount(){ | |
fetch(`http://127.0.0.1:8000/backup/changes/1/Lead.json`) |
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
""" Certain methods are not available via REST API, so we have to recreate!""" | |
import requests | |
from lxml.etree import Element, SubElement, tostring | |
class LeadConverter(object): | |
def __init__(self, session_id, lead_id, **kwargs): | |
""" Provides functionality for converting a Lead to a new or existing | |
Account and create a new Contact or update an existing Contact. |
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
In [30]: my_dataset.add_samples( | |
[ | |
('create a lead [[ person ]], [[ company ]], [[ date ]]', 'create_lead'), | |
('create a new lead [[ person ]], [[ agent ]], [[ date ]]', 'create_lead')], input_type="text") | |
Starting data upload... | |
Traceback (most recent call last): | |
File "/Users/joefusaro/perry/venv/lib/python2.7/site-packages/metamind/api/utils.py", line 33, in make_request | |
return validate_result(response) | |
File "/Users/joefusaro/perry/venv/lib/python2.7/site-packages/metamind/api/utils.py", line 131, in validate_result | |
raise ValueError(result["message"]) |
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
class TextLabeler(): | |
"""Takes a text string and a list of dictionary objects; replaces each | |
occurence of a value in a string with the corresponding key. For example: | |
>>> string = "Let's take a trip to Paris next January" | |
>>> lod = [{'city':'Paris'}, {'month':'January'}] | |
>>> processed = TextLabeler(string, lod) | |
>>> processed.text | |
>>> Let's take a trip to [[ city ]] next [[ month ]] |
NewerOlder