Giter Club home page Giter Club logo

librus-scraper's Introduction

Librus scraper

Funkcje

  • wiadomości
  • ogłoszenia
  • terminarz
  • plan lekcji
  • frekwencja
  • oceny

Instalacja

pip install librus_scraper

Przykłady użycia

Pobieranie wiadomości:

Powiedzmy, że chcemy pobrać 50 najnowszych wiadomości:

from librus_scraper import get_messages, get_cookies

cookies = get_cookies(
    "LOGIN", "PASSWORD"  # login i hasło do librusa synergii
)

messages = get_messages(cookies)

print(messages)

Otrzymujemy:

{
    "pagination": [
        1,  # obecna strona
        2  # ostatnia strona
    ],
    "messages": [  # lista zawierająca pobrane wiadomości
        {
            "nadawca": "James Smith",  # imie i nazwisko
            "temat": "xyz",  # temat wiadomości
            "data": "2005-04-02 21:37:06",  # data wysłania wiadomości
            "href": "/wiadomosci/1/5/1234567/f0",  # link do wiadomości
            "id": "1234567",  # id wiadomości
            "new": True,  # czy ta wiadomość jest nowa?
            "files": True,  # czy ta wiadomość zawiera jakieś pliki?
            "tags": [  # lista tagów (None jeżeli wiadomości nie ma)
                "tag1",
                "tag2"
            ]
        }
    ]
}

Odczytywanie wiadomości:

Powiedzmy, że chcemy pobrać zawartość wiadomości:

from librus_scraper import read_message, get_cookies

cookies = get_cookies(
    "LOGIN", "PASSWORD"  # login i hasło do librusa synergii
)

message = read_message(cookies, "/wiadomosci/1/5/1234567/f0")

print(message)

Otrzymujemy:

{
    "nadawca": "James Smith",  # imie i nazwisko nadawcy
    "temat": "xyz",  # temat wiadomości
    "data": "2005-04-02 21:37:06",  # data wysłania wiadomości
    "data_odczytania": "2005-04-02 21:37:06",  # data odczytania wiadomości
    "tresc": "xyz",  # treść wiadomości
    "files": [
        [
            "file.docx",  # nazwa pliku
            "/wiadomosci/pobierz_zalacznik/1234567/7654321"  # link do pliku
        ]
    ]
}

librus-scraper's People

Contributors

piotr-ginal avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

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