Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
RafalW3bCraft committed Oct 31, 2023
0 parents commit 6217056
Show file tree
Hide file tree
Showing 73 changed files with 4,109 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Twitter/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cSpell.words": [
"tweepy"
]
}
7 changes: 7 additions & 0 deletions Twitter/config.ini
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"
14 changes: 14 additions & 0 deletions Twitter/key-twitter.txt
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
26 changes: 26 additions & 0 deletions Twitter/twitter_api_1.py
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)
1 change: 1 addition & 0 deletions comment.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#hashtag is commet
6 changes: 6 additions & 0 deletions day_1/alpha1.py
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')
6 changes: 6 additions & 0 deletions day_1/alpha10.py
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')
5 changes: 5 additions & 0 deletions day_1/alpha2.py
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!')
4 changes: 4 additions & 0 deletions day_1/alpha3.py
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)
2 changes: 2 additions & 0 deletions day_1/alpha4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name = input('Who are you? ')
print('Welcome', name)
3 changes: 3 additions & 0 deletions day_1/alpha5.py
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)
12 changes: 12 additions & 0 deletions day_1/alpha6.py
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')
13 changes: 13 additions & 0 deletions day_1/alpha7.py
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')
12 changes: 12 additions & 0 deletions day_1/alpha8.py
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')
6 changes: 6 additions & 0 deletions day_1/alpha9.py
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')
10 changes: 10 additions & 0 deletions day_10/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"cSpell.words": [
"ARTX",
"CYWLT",
"Klke",
"requrl",
"Tpja",
"twurl"
]
}
49 changes: 49 additions & 0 deletions day_10/api_geolocation.py
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)
32 changes: 32 additions & 0 deletions day_10/web_serv_apis.py
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)
14 changes: 14 additions & 0 deletions day_11/.vscode/settings.json
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"
]
}
43 changes: 43 additions & 0 deletions day_11/google/geoxml.py
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)
53 changes: 53 additions & 0 deletions day_11/google/map1.py
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
7 changes: 7 additions & 0 deletions day_11/twit/hidden.py
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"
}
17 changes: 17 additions & 0 deletions day_11/twit/key-twitter.txt
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
Loading

0 comments on commit 6217056

Please sign in to comment.