Skip to content

Instantly share code, notes, and snippets.

View kashaziz's full-sized avatar
💭
Contemplating the next Big Idea ...

Kashif Aziz kashaziz

💭
Contemplating the next Big Idea ...
View GitHub Profile
@kashaziz
kashaziz / gist:48c8ca6996ac32e9c143db3231864c54
Created November 25, 2023 15:52
Product review sentiment analysis using python
""" Perform sentiment analysis on product reviews of Amazon product """
import requests
from bs4 import BeautifulSoup
from textblob import TextBlob
def analyze_product_reviews(url):
response = requests.get(url)
soup = BeautifulSoup(response.content, 'html.parser')
reviews = soup.find_all('div', {'data-hook': 'review-collapsed'})
@kashaziz
kashaziz / dropbox_file_renamer.py
Created March 25, 2019 08:15
Rename files in Dropbox using Python SDK and Dropbox API
# input name of image folder
image_folder = str(input("Enter folder name to fetch images: ")).lower()
# instantiate Dropbox connection
dbx = dropbox.Dropbox('dropbox access token')
# proceed if image folder exists in Dropbox
if dbx.files_get_metadata(image_folder).path_lower == image_folder:
# iterate through the files inside Dropbox folder
@kashaziz
kashaziz / scrapingexample.py
Last active February 18, 2025 21:18
Example of web scraping using Python and BeautifulSoup.
'''
Example of web scraping using Python and BeautifulSoup.
Sraping ESPN College Football data
http://www.espn.com/college-sports/football/recruiting/databaseresults/_/sportid/24/class/2006/sort/school/starsfilter/GT/ratingfilter/GT/statuscommit/Commitments/statusuncommit/Uncommited
The script will loop through a defined number of pages to extract footballer data.
'''
from bs4 import BeautifulSoup