Giter Club home page Giter Club logo

gtas's Introduction

(GTAS) GreekTrain Announcements Scraper

This is a small simple scrapper I made in an afternoon to get the latest news of the greek trains. I made it because I wanted to get the latest news of the company and I didn't want to manually check the website every day. It scrapes the news from their website and returns the latest news articles in json format using a simple API.

REQUIREMENTS

  • Python 3.8
  • Venv
  • Pip

Installation

  • Create a virtual environment
    • python3 -m venv venv
  • Activate the virtual environment
    • source venv/bin/activate
  • Install the requirements
    • pip install -r requirements.txt
  • Run the scrapper
    • python scrape_api.py

Usage

The program will respond to the following endpoints:

  • default: Returns the latest news articles in json format of the first page of site
    • ?page=2: Returns the latest news articles in json format of the 3rd page of site
    • en=true: All the news will be returned in english
  • /latest: Returns the latest news article in json format
    • en=true: The news will be returned in english

Response

The response will be in json format and will contain the following fields:

  • title: The title of the news article
  • url: The url of the news article
  • content: The content of the news article
  • id: The id of the news article scraped from the website (can be used as a unique identifier)
  • date: The date of the news article in unix timestamp format , null if the date is not available

gtas's People

Contributors

georgegipa 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.