refabell.blogg.se

Wikibot berkeley
Wikibot berkeley









  1. WIKIBOT BERKELEY FOR FREE
  2. WIKIBOT BERKELEY HOW TO
  3. WIKIBOT BERKELEY INSTALL

After you have created an account, upload the project directory (containing "links.txt", "images" folder, "wikibot.py", and "keys.json") to the site.

WIKIBOT BERKELEY FOR FREE

They have a system called "Tasks" which can run a program daily for free users. This was inconvenient on an immense amount of levels, so I came up with a solution for this version: hosting the bot in the cloud using PythonAnywhere. However, I soon came accross a sizeable problem: I had to run it locally and continuously, using "time.sleep()" to create periodic posting. Even if it was far from perfect, it worked. This program is actually the second version of my WikiBot: I made the original when I was less experienced and when I used a janky Instagram bot library. The program should be fully functional now.

WIKIBOT BERKELEY INSTALL

You will also need to install the following modules: "tweepy", "Pillow", "bs4", and "profanity" (use this link if you do not know how to). Do not forget to rename it to "keys.json" in order for the program to open the correct file (or modify the path in the constructor of the wikibot class in wikibot.py).

wikibot berkeley

This is where you will fill in each key received in the last step (between the quotation marks). You may have noticed that there is a half-empty json file in the repository called "template.json". You will need the "Consumer Key", "Consumer Key Secret", "AccessToken", and "Access Token Secret". This will generate different keys (you can always generate new ones if you forget to copy and paste). Once you have access to this account, you can create a standalone app or a project (I chose a standalone app as I only needed the tweet feature). The first thing you need to do is create a Twitter account, and then apply for an associated developer account at.

WIKIBOT BERKELEY HOW TO

How To Make Your Own WikiBot Apply for a Twitter Developer AccountĪlthough bots are usually not encouraged on most social medias, Twitter actually provides an API that allows an impressive range of actions, most notably tweeting for this use case. Thus, wikibot will continue publishing content until something I have not foreseen happens or the universe ends. To publish it periodically, I used the "Tasks" system on PythonAnywhere so that I did not have to run the program locally. The articles are passed through a profanity check so that inappropriate material is not published. The links that have already been used are stored in "links.txt", so that if you tweet once and stop the program, it will pick up where it left off. The program will then find the intro text, an image, and a link found on the page for the next article so that the cycle continues. The bot acts in a very similar way: for the first post, it requires a starting path, which I chose to be the "Wikipedia" article of Wikipedia. The fastest to do so, usually concerning completely unrelated concepts, such as "Turkmenistan" to "Chicharrones", would win.

wikibot berkeley

Due to the sheer amount of Wikipedia articles as well as the links present on each, it is possible to go from any article to another just by clicking links.

wikibot berkeley

This program is actually loosely based upon a game I used to play with my friends called "Wikipedia Speedrun". Every day, this bot publishes a semi-random Wikipedia article to the account on Twitter.











Wikibot berkeley