This file contains hidden or 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
| #!/usr/bin/python2.7 | |
| # A python example of how to use the update_response method in version 3 of the qualtrics api | |
| # https://api.qualtrics.com/docs/update-response | |
| import requests | |
| import json | |
| url = "https://YOURDATACENTERID.qualtrics.com/API/v3/responses/RESPONSEID" | |
| data = {"surveyId": "SURVEYID", 'embeddedData': {"EDField":"EDValue"}} | |
| headers = {'Content-type': 'application/json', 'X-API-TOKEN' : 'YOURAPITOKEN'} |
This file contains hidden or 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
| try: | |
| for _, r in response_data(survey_ids['product']).iteritems(): | |
| try: | |
| messageHTML += ''' | |
| <p style="margin-bottom: -1em;">Product: <b>{8}</b> Timestamp: <b>{7}</b></p> | |
| <p style="margin-bottom: -1em;">Email: <b>{0}</b></p> | |
| <p style="margin-bottom: -1em;">Overall Rating (1-5): <b>{2}</b></p> | |
| <p style="margin-bottom: -1em;">Likely to Refer (1-5): <b>{4}</b></p> | |
| <p style="margin-bottom: -1em;">Did the website meet your expectations?: <b>{5}</b></p> | |
| <p style="margin-bottom: -1em;">Were you able to accomplish your goal?: <b>{6}</b></p> |
This file contains hidden or 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
| /*************** General ***************/ | |
| * { | |
| font-family: "myriad-pro",Arial,Helvetica,Garuda,sans-serif; | |
| } | |
| #Wrapper { | |
| max-width: 40em !important; | |
| margin: 0 auto !important; | |
| } |
This file contains hidden or 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
| #!/usr/bin/env python | |
| import os | |
| import sys | |
| import glob | |
| from mutagen.mp3 import MP3 | |
| from mutagen.easyid3 import EasyID3 | |
| # | |
| # MP3 playlist generator |
This file contains hidden or 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 selenium import webdriver | |
| from selenium.webdriver.chrome.options import Options | |
| from selenium.webdriver.common.desired_capabilities import DesiredCapabilities | |
| import os | |
| def chromeDriver(): | |
| if os.path.exists('.env'): | |
| for line in open('.env'): | |
| var = line.strip().split('=') | |
| if len(var) == 2: |
This file contains hidden or 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
| CHROME_DRIVER_PATH=/Users/{{name}}/{{example}}/venv/selenium/webdriver/chrome/chromedriver |
This file contains hidden or 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
| def findAllAnchors(url): | |
| # Use requests to get page source without using driver | |
| r = requests.get(url) | |
| # Turn the page source into soup for parsing | |
| soup = bs4(r.text, "html5lib") | |
| # Return a Set of relative anchors tags from a given | |
| return set([anchor for anchor in soup.find_all('a', href=True) if anchor['href'].startswith('/') and not anchor['href'].endswith(('.com', '.org', '.net'))]) |
This file contains hidden or 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
| def visitPage(url, relativeUrl): | |
| global driver | |
| global HTML_string | |
| # Visit the page | |
| driver.get(url+relativeUrl) | |
| # Turn on staging and debug (Optional) | |
| # driver.execute_script(stagingScript) | |
| # driver.execute_script(debugScript) |
This file contains hidden or 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
| def main(): | |
| global target_url | |
| global HTML_string | |
| global driver | |
| relative_anchors = findAllAnchors(target_url) | |
| # Iterate the relative anchors and collect data | |
| for anchor in relative_anchors: | |
| anchorHref = str(anchor['href']) |
This file contains hidden or 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
| $.ajax({ | |
| async: false, | |
| type: 'GET', | |
| url : 'https://survey.qualtrics.com//WRAPI/ControlPanel/api.php?API_SELECT=ControlPanel&Version=2.5&Request=getLegacyResponseData&User=USERNAME&Token=APITOKEN&Format=JSON&SurveyID=SURVEYID&StartDate=2017-02-02%2000%3A00%3A00&LocationData=1', | |
| success: function(data) { | |
| console.log(data); | |
| } | |
| }); |
OlderNewer