Skip to content

Instantly share code, notes, and snippets.

@ronaknnathani
Last active February 6, 2017 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ronaknnathani/a659a02f403d067389674db155bd11a3 to your computer and use it in GitHub Desktop.
Save ronaknnathani/a659a02f403d067389674db155bd11a3 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# Using new TCP connection for each HTTP request
import os
import json
import time
import logging
import requests
from requests.auth import HTTPBasicAuth
logging.basicConfig(level=logging.DEBUG)
start_time = time.time()
def get_venmo_data(limit):
url = "https://venmo.com/api/v5/public?limit={}"
for i in range(50):
response = requests.get(url.format(limit))
response_dict = json.loads(response.text)
for transaction in response_dict["data"]:
print(unicode(transaction["message"]))
url = response_dict["paging"]["next"] + "&limit={}"
if __name__ == "__main__":
limit = 1
get_venmo_data(limit)
print("--- %s seconds ---" % (time.time() - start_time))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment