Skip to content

Instantly share code, notes, and snippets.

20:58:23 INFO:__main__:Admin Acct ID 2129670914:
20:58:23 Project ID --> experiment IDs:
20:58:23 {2129670914: [11789731148, 11791870606, 11970780097, 11952544336, 11726322402]}
20:58:23
20:58:23
20:58:23 INFO:__main__:Admin Acct ID 10847560199:
20:58:23 Project ID --> experiment IDs:
20:58:23 {10864040822: [12010682896, 11950473511, 11992112046, 11946866072]}
20:58:23
20:58:23
20:37:42 INFO:__main__:Admin Acct ID 8209600003:
20:37:42 Project ID --> experiment IDs:
20:37:42 {8780041422: [12000863277]}
20:37:42
20:37:42
20:37:42 INFO:__main__:Admin Acct ID 8024571396:
20:37:42 Project ID --> experiment IDs:
20:37:42 {8024571396: [8481861098]}
20:37:42
20:37:42
import requests
import sys
username, password, api_path = sys.argv[1], sys.argv[2], sys.argv[3]
payload = {'username': username, 'password': password}
API_URL = 'https://api.lotame.com/2/'
AUTH_URL = 'https://crowdcontrol.lotame.com/auth/v1/tickets'
try:
{"accountId": "6452880050",
"anonymizeIP": false,
"attributes": [],
"audiences": [],
"events": [],
"experiments": [{"audienceIds": [],
"forcedVariations": {},
"id": "9182646709",
"key": "ff_experiment",
"layerId": "9183055601",
{'featureFlags': [{'key': 'checkout_sorting', 'experimentIds': ['9180613542'], 'rolloutId': '', 'variables': [{'defaultValue': 'price', 'key': 'sort_type', 'type': 'string', 'id': '1'}, {'defaultValue': 'ascending', 'key': 'sort_order', 'type': 'string', 'id': '2'}], 'id': '9184404319'}], 'rollouts': [], 'projectId': '9203751409', 'version': '4', 'variables': [], 'audiences': [{'name': 'everyone', 'conditions': '["and", ["or", ["or", {"name": "everyone", "type": "custom_attribute", "value": "True"}]]]', 'id': '9187603024'}], 'groups': [], 'attributes': [{'key': 'everyone', 'id': '9218530874'}], 'revision': '11', 'accountId': '6452880050', 'anonymizeIP': False, 'events': [{'key': 'click_buy', 'experimentIds': ['9189247232'], 'id': '9208673897'}], 'experiments': [{'key': 'python_mvt', 'status': 'Running', 'layerId': '9188664649', 'trafficAllocation': [{'endOfRange': 2500, 'entityId': '255987204241808423'}, {'endOfRange': 5000, 'entityId': '440055457139948934'}, {'endOfRange': 7500, 'entityId': '3064754579497450
@jo-migo
jo-migo / setup_script.bash
Last active November 8, 2017 20:19
Setup Script for Fullstack MVT Generator
#!/bin/bash
# If you don't have trailmix installed, you have to run `sudo pip install -i https://localshop.dz.optimizely.com/simple/ --upgrade --ignore-installed trailmix` first!!
export PISTACHIO_PATH=$1
export PISTACHIO_BUCKET=optimizely-pci-pistachio
eval $(trailmix --escape-quotes -f exports frontdoor)
export PROXY_SHARED_SECRET=$THREESCALE_SHARED_SECRET
@jo-migo
jo-migo / generate_fullstack_mvt.py
Last active November 8, 2017 21:26
Script to Generate a Generic Fullstack MVT
import json
import os
import pprint
import requests
import sys
'''
DIRECTIONS:
- run `export ACCESS_TOKEN=<insert personal access token>` in the terminal (go to Profile > API Access to generate a PAT if you don't have one already)
- run setup_script.sh
@jo-migo
jo-migo / batch_update_delete_tool.py
Last active November 3, 2016 22:37
Batch Update/Delete Tool Using V2 REST API
import ast
import uuid
import json
import sys
import bravado
from distutils import util
from pyramid import settings as p_settings
from bravado.client import SwaggerClient