-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6217056
Showing
73 changed files
with
4,109 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"cSpell.words": [ | ||
"tweepy" | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[twitter] | ||
|
||
api_key = "T0O0kBC6L6Y9364XvB4ZCmjOE" | ||
api_key_secret = "3k0NpzAZucwclKgFNEkDv010UCxj2gNy0N7FngrZbpe2xmuGPu" | ||
|
||
access_token = "1647893887401472000-Izrux3KdZ2yLTErxM1v2uIpX0eCrJP" | ||
access_token_secret = "6DKqlA7lWdyGIY9CLvOQGnQIWorsafBZUA6cRyWj3uyP3" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
api_key=T0O0kBC6L6Y9364XvB4ZCmjOE | ||
api_key_secret=3k0NpzAZucwclKgFNEkDv010UCxj2gNy0N7FngrZbpe2xmuGPu | ||
Bearer_token=AAAAAAAAAAAAAAAAAAAAAHP1qgEAAAAAthcuRpt%2Bdw1m1b%2FadBU%2BrOUGxSc%3D1KYBsnoxHNdME5m1DtgjLPLjv0EdQnlu7SYoivJ4mZAVkFj5Me | ||
Access_token=1647893887401472000-Izrux3KdZ2yLTErxM1v2uIpX0eCrJP | ||
Access_token_secret=6DKqlA7lWdyGIY9CLvOQGnQIWorsafBZUA6cRyWj3uyP3 | ||
|
||
|
||
<!-- Pixel Code for https://proofmonster.com/ --> | ||
<script defer src="https://proofmonster.com/pixel/5szevcobabyd31r6mbr8uof9agh0bdx6"></script> | ||
<!-- END Pixel Code --> | ||
|
||
|
||
client_id=VmMxc3J3aVQ5UFJoc3RNNmo2bVY6MTpjaQ | ||
client_secret=-8rJv7SqsdWz9-KhNoFqdixN98vXMLXhCMYZFHh38zVz0nCpXk |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import tweepy | ||
|
||
#bearer_token = "AAAAAAAAAAAAAAAAAAAAAHP1qgEAAAAAthcuRpt%2Bdw1m1b%2FadBU%2BrOUGxSc%3D1KYBsnoxHNdME5m1DtgjLPLjv0EdQnlu7SYoivJ4mZAVkFj5Me" | ||
|
||
consumer_key = "T0O0kBC6L6Y9364XvB4ZCmjOE" | ||
consumer_secret = "3k0NpzAZucwclKgFNEkDv010UCxj2gNy0N7FngrZbpe2xmuGPu" | ||
|
||
access_token = "1647893887401472000-Izrux3KdZ2yLTErxM1v2uIpX0eCrJP" | ||
access_token_secret = "6DKqlA7lWdyGIY9CLvOQGnQIWorsafBZUA6cRyWj3uyP3" | ||
auth = tweepy.OAuth1UserHandler( | ||
consumer_key, consumer_secret, access_token, access_token_secret | ||
) | ||
|
||
api = tweepy.API(auth) | ||
|
||
user = 'veritasium' | ||
limit =100 | ||
|
||
tweets = api.user_timeline(screen_name=user, count=limit, tweet_mode='extended') | ||
columns = ['User', 'Tweet'] | ||
data = [] | ||
for tweet in tweets: | ||
data.append([tweet.user.screen_name, tweet.full_text]) | ||
df = pd.DataFrame(data, columns=columns) | ||
|
||
print(df) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#hashtag is commet |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
x=5 | ||
if x < 10: | ||
print('Smaller') | ||
if x > 20: | ||
print('Bigger') | ||
print('Finis') |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
x = 4 | ||
if x > 2: | ||
print('Bigger') | ||
else: | ||
print('Smaller') | ||
print('All done') |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
n=5 | ||
while n > 0 : | ||
print(n) | ||
n=n-1 | ||
print('Blastoff!') |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
hours = 35.0 | ||
rate = 13.5 | ||
pay = hours * rate | ||
print(pay) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
name = input('Who are you? ') | ||
print('Welcome', name) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
inp = input('Europe floor?') | ||
usf = int(inp) + 1 | ||
print('US floor', usf) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
x = 5 | ||
if x == 5: | ||
print('Equals 5') | ||
if x > 4: | ||
print('Greater than 4') | ||
if x >= 5: | ||
print('Greater than or Equals 5') | ||
if x < 6 : print('Less than 6') | ||
if x <= 5: | ||
print('Less than or Equals 5') | ||
if x != 6: | ||
print('Not equal 6') |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
x = 5 | ||
print('Before 5') | ||
if x == 5: | ||
print('Is 5') | ||
print('Is Still 5') | ||
print('Third 5') | ||
print('Afterwards 5') | ||
print('Before 6') | ||
if x == 6: | ||
print('Is 6') | ||
print('Is Still 6') | ||
print('Third 6') | ||
print('Afterwards 6') |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
x = 5 | ||
if x > 2: | ||
print('Bigger than 2') | ||
print('Still bigger') | ||
print('Done with 2') | ||
|
||
for i in range(5): | ||
print(i) | ||
if i > 2: | ||
print('Bigger than 2') | ||
print('Done with i', i) | ||
print('All Done') |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
x = 42 | ||
if x > 1: | ||
print('More than one') | ||
if x < 100: | ||
print('Less than 100') | ||
print('All Done') |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"cSpell.words": [ | ||
"ARTX", | ||
"CYWLT", | ||
"Klke", | ||
"requrl", | ||
"Tpja", | ||
"twurl" | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#working with false api key | ||
|
||
import urllib.request, urllib.parse, urllib.error | ||
import json | ||
|
||
api_key = False | ||
# If you have a Google Places API key, enter it here | ||
# api_key = 'AIzaSy___IDByT70' | ||
# https://developers.google.com/maps/documentation/geocoding/intro | ||
|
||
if api_key is False: | ||
api_key = 42 | ||
serviceurl = 'http://py4e-data.dr-chuck.net/json?' | ||
else : | ||
serviceurl = 'https://maps.googleapis.com/maps/api/geocode/json?' | ||
|
||
|
||
|
||
while True: | ||
address = input('Enter location: ') | ||
if len(address) < 1: break | ||
|
||
parms = dict() | ||
parms['address'] = address | ||
if api_key is not False: parms['key'] = api_key | ||
url = serviceurl + urllib.parse.urlencode(parms) | ||
|
||
print('Retrieving', url) | ||
uh = urllib.request.urlopen(url) | ||
data = uh.read().decode() | ||
print('Retrieved', len(data), 'characters') | ||
|
||
try: | ||
js = json.loads(data) | ||
except: | ||
js = None | ||
|
||
if not js or 'status' not in js or js['status'] != 'OK': | ||
print('==== Failure To Retrieve ====') | ||
print(data) | ||
continue | ||
|
||
print(json.dumps(js, indent=4)) | ||
|
||
lat = js['results'][0]['geometry']['location']['lat'] | ||
lng = js['results'][0]['geometry']['location']['lng'] | ||
print('lat', lat, 'lng', lng) | ||
location = js['results'][0]['formatted_address'] | ||
print(location) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#lv web service to retrieve location data from google cloud using map api as this just opens doors for study | ||
#this one is without api key | ||
|
||
import urllib.request, urllib.parse, urllib.error | ||
import json | ||
|
||
requrl = 'http://maps.googleapis.com/maps/api/geocode/json?' | ||
while True: | ||
address = input('Enter Location: ') | ||
if len(address) < 1: | ||
break | ||
url = requrl + urllib.parse.urlencode({'address': address}) | ||
print('Retrieving', url) | ||
uh = urllib.request.urlopen(url) | ||
data = uh.read().decode() | ||
print('Retrieved', len(data), 'characters') | ||
|
||
try: | ||
js = json.loads(data) | ||
except: | ||
js = None | ||
|
||
if not js or 'status' not in js or js['status'] != 'OK': | ||
print('==== Failure To Retrieve ====') | ||
print(data) | ||
continue | ||
|
||
lat = js["results"][0]["geometry"]["location"]["lat"] | ||
lng = js["results"][0]["geometry"]["location"]["lng"] | ||
print('lat', lat, 'lng', lng) | ||
location = js["results"][0]["formatted_address"] | ||
print(location) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"cSpell.words": [ | ||
"BNKQ", | ||
"eofta", | ||
"Fxck", | ||
"Iukw", | ||
"Jtyqy", | ||
"Pcpn", | ||
"Pwdiq", | ||
"twurl", | ||
"VHMJD", | ||
"Ybdy" | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import urllib.request, urllib.parse, urllib.error | ||
import xml.etree.ElementTree as ET | ||
import ssl | ||
|
||
api_key = False | ||
# If you have a Google Places API key, enter it here | ||
# api_key = 'AIzaSy___IDByT70' | ||
# https://developers.google.com/maps/documentation/geocoding/intro | ||
|
||
if api_key is False: | ||
api_key = 42 | ||
serviceurl = 'http://py4e-data.dr-chuck.net/xml?' | ||
else : | ||
serviceurl = 'https://maps.googleapis.com/maps/api/geocode/xml?' | ||
|
||
# Ignore SSL certificate errors | ||
ctx = ssl.create_default_context() | ||
ctx.check_hostname = False | ||
ctx.verify_mode = ssl.CERT_NONE | ||
|
||
while True: | ||
address = input('Enter location: ') | ||
if len(address) < 1: break | ||
|
||
parms = dict() | ||
parms['address'] = address | ||
if api_key is not False: parms['key'] = api_key | ||
url = serviceurl + urllib.parse.urlencode(parms) | ||
print('Retrieving', url) | ||
uh = urllib.request.urlopen(url, context=ctx) | ||
|
||
data = uh.read() | ||
print('Retrieved', len(data), 'characters') | ||
print(data.decode()) | ||
tree = ET.fromstring(data) | ||
|
||
results = tree.findall('result') | ||
lat = results[0].find('geometry').find('location').find('lat').text | ||
lng = results[0].find('geometry').find('location').find('lng').text | ||
location = results[0].find('formatted_address').text | ||
|
||
print('lat', lat, 'lng', lng) | ||
print(location) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import urllib.request, urllib.parse, urllib.error | ||
import json | ||
import ssl | ||
|
||
api_key = False | ||
# If you have a Google Places API key, enter it here | ||
# api_key = 'AIzaSy___IDByT70' | ||
# https://developers.google.com/maps/documentation/geocoding/intro | ||
|
||
if api_key is False: | ||
api_key = 42 | ||
serviceurl = 'http://py4e-data.dr-chuck.net/json?' | ||
else : | ||
serviceurl = 'https://maps.googleapis.com/maps/api/geocode/json?' | ||
|
||
# Ignore SSL certificate errors | ||
ctx = ssl.create_default_context() | ||
ctx.check_hostname = False | ||
ctx.verify_mode = ssl.CERT_NONE | ||
|
||
while True: | ||
address = input('Enter location: ') | ||
if len(address) < 1: break | ||
|
||
parms = dict() | ||
parms['address'] = address | ||
if api_key is not False: parms['key'] = api_key | ||
url = serviceurl + urllib.parse.urlencode(parms) | ||
|
||
print('Retrieving', url) | ||
uh = urllib.request.urlopen(url, context=ctx) | ||
data = uh.read().decode() | ||
print('Retrieved', len(data), 'characters') | ||
|
||
try: | ||
js = json.loads(data) | ||
except: | ||
js = None | ||
|
||
if not js or 'status' not in js or js['status'] != 'OK': | ||
print('==== Failure To Retrieve ====') | ||
print(data) | ||
continue | ||
|
||
print(json.dumps(js, indent=4)) | ||
|
||
lat = js['results'][0]['geometry']['location']['lat'] | ||
lng = js['results'][0]['geometry']['location']['lng'] | ||
print('lat', lat, 'lng', lng) | ||
location = js['results'][0]['formatted_address'] | ||
print(location) | ||
|
||
# Code: http://www.py4e.com/code3/geojson.py |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
def oauth(): | ||
return { | ||
"consumer_key": "TpWV5YbdyJ2GvRcPwdiq5Pcpn", | ||
"consumer_secret": "gL4eoftaQrN0tNuNJy8Fb6mZpPgjP2F0Enm9kVHMJDHwFxckF9", | ||
"token_key": "1647893887401472000-UeQkeW0HaQwrWpLvHxLpJ3Tc0eBNKQ", | ||
"token_secret": "Q2as39GHyBEqAcWTeIukwGDcCJtyqyMui7qt8DsEx4oUZ" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Access Token = 1647893887401472000-UeQkeW0HaQwrWpLvHxLpJ3Tc0eBNKQ | ||
|
||
Access Token Secret = Q2as39GHyBEqAcWTeIukwGDcCJtyqyMui7qt8DsEx4oUZ | ||
|
||
|
||
API Key = TpWV5YbdyJ2GvRcPwdiq5Pcpn | ||
|
||
API Key Secret = gL4eoftaQrN0tNuNJy8Fb6mZpPgjP2F0Enm9kVHMJDHwFxckF9 | ||
|
||
Bearer Token = AAAAAAAAAAAAAAAAAAAAAI0SqwEAAAAAcHrDkHIHMsvep2rerIa5WkdDYtU%3DyJBdIA0i5w6oiZI85VzuaCyPCdLAddEtry6C1ds20LAuYjNxcY | ||
|
||
<!-- Pixel Code for https://proofmonster.com/ --> | ||
<script defer src="https://proofmonster.com/pixel/5szevcobabyd31r6mbr8uof9agh0bdx6"></script> | ||
<!-- END Pixel Code --> | ||
|
||
|
||
client_id=X3JDdXE4TWxtMEwwOU5LcU5fMGw6MTpjaQ client_secret=kmdkAW5CEvQfcjtuDuH3FAiVeyPNuq4WNqL9qOmzGtRMABENwQ |
Oops, something went wrong.