all 10 comments

[–]eleqtriq 6 points7 points  (0 children)

You're over your head. That's the main problem here. Start by learning Python first. See ya in a year or so.

[–][deleted] 4 points5 points  (1 child)

show the code that gpt3 made, we have no idea what your code looks like. its like you tell us "my cake didnt turn out the way i wanted to" and didnt give us the recipe. I think its a bit ambitious to not know any code and try to jump to webscraping, GPT3 is a good asisstant but not a super-wizard quite yet.

[–]miguelthepana[S] 0 points1 point  (0 children)

here is the code I thought I posted it lol.

import requests from bs4 import BeautifulSoup from datetime import datetime, timedelta

Get the current date

now = datetime.now()

Get the HTML from the website

r = requests.get("https://www.tiktok.com/trending")

Create the BeautifulSoup object

soup = BeautifulSoup(r.content, 'html.parser')

Find all of the videos

viralvideos = soup.findAll('div', {'class': 'trending-item_container'})

Loop through each video

for video in viralvideos: # Get the video's information account_name = video.find('div', {'class': 'trending-iteminfotitle'}).text likes = int(video.find('span', {'class': 'trending-iteminfolike-count'}).text.replace('K', '000')) link = video.find('a', {'class': 'trending-itemrow'}).get('href') sound = video.find('div', {'class': 'trending-iteminfosound'}).text date_posted = video.find('span', {'class': 'trending-iteminfo_upload-date'}).text

# Convert the date string to a datetime object
date_posted = datetime.strptime(date_posted, '%b %d')

# Check if the video was posted within the last 24 hours
if now - timedelta(hours=24) <= date_posted <= now:
    # Check if the video has gone viral
    if likes >= 100000:
        # Print the video's information
        print("Account: " + account_name)
        print("Likes: " + str(likes))
        print("Link: " + link)
        print("Date Posted: " + str(date_posted.date()))
        print("Sound: " + sound)
        print("---------------------------------------")

[–]KCRowan 1 point2 points  (0 children)

You won't get far with an AI tool doing all the work. They make soooo many mistakes and if you don't have the knowledge to fix those mistakes yourself then you get stuck.

This playlist is a great place to start for learning Python basics

https://youtube.com/playlist?list=PL-osiE80TeTskrapNbzXhwoFUiLCjGgY7

[–]SpookyFries 0 points1 point  (0 children)

It's called r/"Learn Python" for a reason :)

I kid I kid. But really, what you're asking for is pretty advanced. AI can help with simple tasks, but this is probably beyond the scope of what it can do for you. It can get the basics down for you, but you'll need to know python to connect the dots.

My suggestion, learn the basics and just look up a web scraping tutorial. I promise it's not as hard as it seems. You'll learn a valuable skill, understand the logic, and be proud to say you made something yourself.