Skip to content

Latest commit

 

History

History
117 lines (90 loc) · 3.42 KB

README.md

File metadata and controls

117 lines (90 loc) · 3.42 KB

nobo, No Borders

This is a personal open source project. Please use nobo at your own risk.

nobo is a spider that you could get your data from each service provides by Ritsumeikan Univ.
You can use nobo to build your own data API with many frameworks(Flask, Django etc.).

NOTICE

Ritsumeikan University deployed f5 obfuscator several months ago. :(
Although, I don't know the situation in other schools. The truth is legacy version cannot work perfectly nowadays.
But if you wanna build your own spider with legacy version, please check the legacy branch.

The mainly difference between legacy version and master version:

  1. legacy use requests to send requests, but master use webdriver for Chrome.
  2. legacy is faster, but it cannot handle the page with code confusion.

Fix list

  • [manaba] course list @ 7/28/2018
  • [manaba] better performance @ 1/28/2019
  • [syllabus] ritsumei syllabus -> manaba syllabus
  • [syllabus] get syllabus by id

New feature

  • [manaba] announcement list
  • [syllabus] search syllabus by string
  • [compusweb] scholarship information
  • [compusweb] final test information
  • [compusweb] grade information

License

GPLv3

How to import?

  1. Install Python 3.
    Recommended Python Version: 3.7.1+

  2. Install nobo with pip / pip3

    pip3 install nobo
  3. Install latest version of Chrome and ChromeDriver

    • Chrome, latest version is recommended
    • ChromeDriver, unzip and move chromedriver/chromedriver.exe into your project directory.
  4. Use nobo in your project (.py).

    import nobo
    # if you wanna output in an easy way
    import nobo.io

Manaba Spider

It seems that Manaba of each school are different, you can change a little bit code inside manaba.py to let nobo be compatible with your manaba page.

How to use

  1. Create a RitsStudent instance.

    fangzhou = nobo.RitsStudent("is0000ab", "12345678")
  2. Use get_course_list() method to get all courses information.
    get_course_list() will login automatically. After parsing, it will return a list that contains all information of courses.
    Use try...except...finally... to handle exceptions is highly recommanded.

    try:
        course_list = fangzhou.get_course_list()
        nobo.io.export_as_json("temp.json", course_list)
    finally:
        exit()

Course list example

The example course will show as following.

[
    {
        "basic": [
            {
                "code": 33698,
                "name": "ソフトインテリジェンス",
                "class": "D1"
            }
        ],
        "time": {
            "year": 2018,
            "semester": "fall",
            "weekday": "Wednesday",
            "period": "2",
            "sci_period_start": "3",
            "sci_period_end": "4"
        },
        "room": "C402",
        "teacher": [
            "前田 陽一郎"
        ]
    },
    {
        ...
        other courses
        ...
    }
]