Code Monkey home page Code Monkey logo

cs361_microservice's Introduction


Wikipedia Scraper for Game Development Guide Microservice

Python Packages to Install

Open up Terminal.

pip install wikipedia

How to Start Microservice

Start the service in Terminal.

python wiki.py

How to REQUEST Data

Users can request data from this microservice by simply typing in a keyword into the interface’s search engine. It would then match up with the closest-matching Wikipedia article. Here is an example call:

# Clear
def clear():
    my_entry.delete(0, END)
    my_text.delete(0.0, END)


# Search
def search():
    data = wiki.page(my_entry.get())
    # Clear screen
    clear()
    # Output Wikipedia Results to Textbox
    my_text.insert(0.0, data.content)
    
    
>>> [wiki] Pulling information from {data.title}

How to RECEIVE Data

On the same file, there is a function that will gather all of the headings and details of the article from the Wikipedia URL that the user requested. All the user must do is type their keywords in the search engine and the appropriate data should appear on the screen. Said data will also go into a .txt file that the user gets to name of their choice. All .txt. files will go to the ./information directory.

# Write to File
def writeFile():
    save_path = './information'
    file_name = input("Article name: ") + ".txt"
    # Saving .txt file to the /information directory
    completeName = os.path.join(save_path, file_name)
    file = open(completeName, "a+")
    # Output Wikipedia Results to .txt file 
    file.write(my_text.get("1.0", 'end-1c') + '\n')
    file.close()


>>> Article name: {write your custom title here}

UML Sequence Diagram

UML Diagram

(back to top)

cs361_microservice's People

Contributors

malloryhuston avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.