Skip to content

Commit

Permalink
Merge pull request #5 from unixdevil/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
izdrail authored Feb 2, 2023
2 parents 8eada92 + f837227 commit caf2c13
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 5 deletions.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
FROM python:3.10
RUN apt update
RUN apt install curl
WORKDIR /app/
ADD requirements.txt /app/
ADD . /app/
RUN apt install chromium -y
RUN su -c "apt-get install curl"

#RUN su -c "apt install chromium -y"
RUN su -c "curl -s https://deb.nodesource.com/setup_16.x | bash"
RUN su -c "apt install nodejs -y"
RUN su -c "npm install -g lighthouse"
RUN su -c "pip3 install git+https://github.com/unixdevil/lighthouse-python.git#egg=lighthouse"
RUN su -c "pip3 install html5lib"
RUN su -c "pip3 install hypercorn"
RUN su -c "pip3 install google-search-results"
RUN su -c "pip3 install socials"
RUN su -c "pip3 install feedfinder2"
RUN su -c "pip3 install pika"
RUN su -c "pip3 install pyseoanalyzer"
RUN su -c "pip3 install email-validator"
Expand Down
16 changes: 12 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import socials
import datetime as dt
from markdownify import markdownify as md

from feedfinder2 import find_feeds
from fastapi import FastAPI, Response
from fastapi.middleware.cors import CORSMiddleware
from newspaper import Config
Expand Down Expand Up @@ -53,6 +53,10 @@
"name": "feed-reader",
"description": "This will extract the latest entries from a feed",
},
{
"name": "feed-finder",
"description": "This will try to find the feeds associated with a domain",
},
{
"name": "article",
"description": "This will extract the article from a feed and provide you with some nlp tasks",
Expand Down Expand Up @@ -140,9 +144,6 @@ async def root(google: GoogleNewsAction):
}}


"""Article Extract"""


@app.post("/feed-reader")
async def root(feed: FeedReader):
response = feedparser.parse(feed.link)
Expand All @@ -154,7 +155,14 @@ async def root(feed: FeedReader):
},

}}
@app.post("/feed-finder")
async def root(feed: FeedReader):
response = find_feeds(feed.link)
return {"data": {
"feed-link": feed.link,
"response": response,

}}
@app.post("/article")
async def root(feed: FeedReader):
user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) ' \
Expand Down
62 changes: 62 additions & 0 deletions olx.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
'''
By: Donald Lee
Date: August 10th-13th, 2020
For instructions or information, please refer to https://github.com/Donald-K-Lee/InstagramDMBot/blob/master/README.md
Please do NOT use this for spam, bullying, etc.
By using this script, YOU will take FULL responsibility for anything that happens to ANYONE you use this on and anything you do with this script!.
Additionally, using this script may involve a risk of you being banned and even other risks including but not limited to: being hacked, etc.
Use this script at your own risk!
'''

from selenium import webdriver
# To wait for side load
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver import ActionChains

from selenium.webdriver.support import expected_conditions as EC

# Allows us to use keyboard keys
from selenium.webdriver.common.keys import Keys
import time

username = "nomaxvalue" # Enter in your email for Instagram inside the quotation marks
mypassword = "garcelino87#" # Enter in your password for Instagram inside the quotation marks
friendusernames = ["alina_kiss_aa"] # Enter in the username of the recipient inside the quotation marks! To send this to mutiple users, seperate users by commas! Ex) friendusernames = ["@friend1", "@friend2", "@friend3"]
numoftimes = "1" # Enter in the number of times you would like to send the message to the recipient Ex) "2"

# The message being sent
message = ""

PATH = "/usr/bin/chromedriver" # Step 4 of the installations instructions

driver = webdriver.Chrome(PATH)

url = "https://www.olx.ro/d/oferta/transport-persoane-germania-la-adresa-IDeFjlS.html"
driver.get(url)

try:
#/html/body/div[3]/div[3]/div/div[1]/div/div[2]/div/button[1]

try:
dmbtn = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, '/html/body/div[3]/div[3]/div/div[1]/div/div[2]/div/button[1]')))
dmbtn.click()
except:
print ("Could not find accept cookies button")
try:
dmbtn = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, '/html/body/div[2]/div[1]/div[3]/div[3]/div[2]/div[1]/div[3]/div/button[1]')))
dmbtn.click()
time.sleep(15)
dmbtn.until(EC.element_to_be_clickable(By.XPATH,'/html/body/div[2]/div[1]/div[3]/div[3]/div[2]/div[1]/div[3]/div/button[1]/span/a'))
print(dmbtn.getText())

except:
print ("Could not find call button")


except:
print("An error has occurred")
time.sleep(1)
driver.quit()

0 comments on commit caf2c13

Please sign in to comment.