Skip to content

Commit

Permalink
v0.6
Browse files Browse the repository at this point in the history
Some improvements
  • Loading branch information
deedy5 authored Aug 19, 2021
1 parent 48e1b9c commit 2c4df93
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fake_traffic.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from google_searching import ggl
from google_trends import realtime_trends

__version__ = 0.5
__version__ = 0.6

def real_trends(country='US', language='en-US'):
trends = realtime_trends(country=country, language=language, category='h', num_results=20)
Expand Down Expand Up @@ -46,7 +46,8 @@ def parse_urls(response):
"mediawiki", ".css", ".ico", ".xml", "intent/tweet",
"twitter.com/share", "signup", "login", "dialog/feed?",
".json", ".svg", ".gif", "zendesk", "clickserve",
"mailto:"]
"mailto:", "smart-captcha/", "Login", "mail.google.com",
".jpg", ".jpeg", ".png", ".iso",]
try:
tree = html.fromstring(response.text)
tree.make_links_absolute(response.url)
Expand Down Expand Up @@ -95,7 +96,7 @@ def fake_traffic(country='US', language='en-US'):
for i, url in enumerate(article_urls, start=1):
recursive_browse(url)
print(f"{i}/{len(article_urls)} urls recursive browsing.")
sleep(uniform(1, 5))
sleep(uniform(1, 10))

if __name__ == '__main__':
fake_traffic(country='US', language='en-US')

0 comments on commit 2c4df93

Please sign in to comment.