a place to put my final projects to look back on and study,
just a little home for some of my assignments as a backlog.
a place to put my final projects to look back on and study, since I quickly forget the ins and outs of python
For techheadz.xyz header
<style> .header-container { position: relative; height: 200px; overflow: hidden; }.pixel {
position: absolute;
display: block;
width: 10px;
height: 10px;
background-color: #333;
animation: raining 2s infinite;
}
.dancing-headline {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 48px;
font-weight: bold;
color: #333;
animation: dancingHeadline 2s infinite;
}
@keyframes raining {
0% {
transform: translateY(-20px) rotate(0deg);
opacity: 0;
}
50% {
opacity: 1;
}
100% {
transform: translateY(100vh) rotate(360deg);
opacity: 0;
}
}
@keyframes dancingHeadline {
0% {
transform: translate(-50%, -50%) rotate(0deg);
}
25% {
transform: translate(-50%, -50%) rotate(-10deg);
}
50% {
transform: translate(-50%, -50%) rotate(10deg);
}
75% {
transform: translate(-50%, -50%) rotate(-5deg);
}
100% {
transform: translate(-50%, -50%) rotate(0deg);
}
}
<h1 class="dancing-headline">
TechHeadz.xyz
</h1>
Might offer advertising on the website... and have my tweets also make a blog post on techheadz
So i just have to feed it 12 papers a day.
Heres an automated template of my idea
import requests
from bs4 import BeautifulSoup
import re
import openai
import tweepy
import time
# Set up OpenAI API credentials
openai.api_key = 'YOUR_API_KEY'
# Twitter API credentials
consumer_key = 'YOUR_CONSUMER_KEY'
consumer_secret = 'YOUR_CONSUMER_SECRET'
access_token = 'YOUR_ACCESS_TOKEN'
access_token_secret = 'YOUR_ACCESS_TOKEN_SECRET'
# List of paper links
paper_links = [
'https://example.com/paper1',
'https://example.com/paper2',
# Add more paper links here
]
# Function to scrape relevant content from a given paper link
def scrape_paper_content(link):
response = requests.get(link)
html_content = response.text
soup = BeautifulSoup(html_content, 'html.parser')
# Extract relevant content using appropriate selectors
title = soup.find('h1').text.strip()
abstract = soup.find('div', class_='abstract').text.strip()
paper_text = soup.find('div', class_='paper-text').text.strip()
# Preprocess the text
title = re.sub('\n+', ' ', title)
abstract = re.sub('\n+', ' ', abstract)
paper_text = re.sub('\n+', ' ', paper_text)
return title, abstract, paper_text
# Function to generate a tweet for a given paper
def generate_paper_tweet(link):
title, abstract, paper_text = scrape_paper_content(link)
# Prepare the content to send to the language model
prompt = f"Title: {title}\n\nAbstract: {abstract}\n\nPaper: {paper_text}"
response = openai.Completion.create(
engine='text-davinci-003',
prompt=prompt,
max_tokens=279,
temperature=0.7,
n=1,
stop=None
)
summary = response.choices[0].text.strip()
# Generate relevant hashtags based on the paper's topic
hashtags = get_paper_hashtags(title)
# Generate the tweet
tweet = f"{summary} Read more: {link} {hashtags}"
return tweet[:279] # Limit to 279 characters
# Function to generate relevant hashtags based on the paper's topic
def get_paper_hashtags(title):
# Generate relevant hashtags based on the paper's topic
# You can customize this function based on your specific requirements
# Here's an example implementation that generates three hashtags based on the words in the paper title
words = title.split()
hashtags = ['#'+word.lower() for word in words if len(word) > 3][:3]
return ' '.join(hashtags)
# Function to authenticate and post a tweet
def tweet(message):
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
api.update_status(message)
# Main loop
for link in paper_links:
try:
tweet_text = generate_paper_tweet(link)
tweet(tweet_text)
print("Tweeted:", tweet_text)
except Exception as e:
print("Error:", str(e))
time.sleep(2 * 60 * 60) # Sleep for 2 hours
# Stop the program after iterating through the list
print("Finished processing all paper links. Program stopped.")
``
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.