Psst.. new poll here.
[email protected] webmail now available. Want one? Go here.
Cannot use outlook/hotmail/live here to register as they blocking our mail servers. #microsoftdeez
Obey the Epel!
Paste
Pasted as Python by registered user martindagglinne ( 5 years ago )
import scrapy
import requests
from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings
settings = get_project_settings()
print("Teknoseyir kullanısı @Martin tarafından hazırlanmıştır. \n")
wordpress_logged_in = input("wordpress_logged_in_xxx ile başlayan kodun tamamını yapıştır. : ")
wordpress_user_hex = input("Cookie kodunu yapıştır : ")
class TeknoYazarParsa (scrapy.Spider):
name = "engelleyenler"
def start_requests(self):
users = []
f = open("All_active_users.txt", "r", encoding="utf8")
if f:
for x in f:
users.append("https://teknoseyir.com/u/"+x.strip())
f.close()
# for i in range(1, 2):
# rjson = requests.get(
# "https://teknoseyir.com/wp-json/wp/v2/users?page={}&per_page=100".format(i))
# if rjson.status_code == 200:
# data = rjson.json()
# for user in data:
# users.append("https://teknoseyir.com/u/"+user['slug'])
for url in users:
yield scrapy.Request(
url,
cookies={wordpress_logged_in:wordpress_user_hex},
callback=self.parse,
meta={
'handle_httpstatus_all': True,
'dont_retry': True,
},
)
def parse(self, response):
kullanici = response.url.split("/")
if response.status == 302:
f = open("engelleyenler.txt", "a", encoding="utf8")
f.write("@"+kullanici[4] + "\n")
yield {
'kullanici': "@"+kullanici[4]
}
# Create a process
process = CrawlerProcess( settings )
process.crawl(TeknoYazarParsa)
process.start()
Revise this Paste