Giter Site home page Giter Site logo

fetch's Introduction

URL Fetcher based on Python3

This is a simple URL fetcher based on python3. All the requirements have been noted in the requirements.txt file.

To run the CLI program, run the driver program src/main.py. You can use the -h switch to see the help on the CLI.

Example run:

    python3 src/main.py https://google.com https://example.com

You can specify the --metadata flag to get some metadata information of the URl as well. Example:

    python3 src/main.py --metadata https://google.com
    site: google.com
    num_links: 20
    images: 1
    last_fetch: Mon Oct 25 16:52:20 2021

Using the Dockerfile

The project comes with a Dockerfile which allows you to use the program through a Docker environment. First, you need to build the program image:

    docker build -t fetcher-app .

when the image is done building, you can invoke the program in a Docker environment with:

    docker run fetcher-app python3 src/main.py --metadata https://google.com/

This will start a container in your local docker environment and run the program in it.

Future Improvements

Add multithreading to accelerate the URL fetching with a new class that operates on ThreadPoolExecutor objects.

Fix the src= field of img tags to point to local cache dir.

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.