Skip to content
Back end Web Scraper for SkolportalN 2.0
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib/beautifulsoup4-4.1.3
.gitignore
README.md
config.py
datehelper.py
error.py
fetch-food.json
fetch-food.sublime-workspace
fetchfood.py
food.py
http.py
mail.py
parse.py

README.md

#fetch-food fetch-food is a back end web scraper with the purpose to provide current menu data from Nacka Gymnasium's cantina's web page to SkolportalN 2.0. It uses BeautifulSoup along with the built in python HTML parser.

##Functionality

  1. GET request to http://www.amica.se/nackagymnasium, getting the web page containing the menu.
  2. Parse the HTML and trim the data.
  3. Parse the food entries in the menu along with the menu's date stamp and create structurized entries.
  4. POST the structurized entries to http://portaln.se/skola.

##Components

  • fetchfood.py - main
  • food.py - classes and functions for parsing and handling food entries
  • post.py - functions for POSTing data to server
  • datehelper.py - helper functions for parsing and converting dates
  • mail.py - functions for sending status/error e-mails
  • error.py - error handling
  • config.py - config file
  • passwd.py - (not on github) contains passwords for POSTing data and sending e-mails

##The FoodEntry object

date = "2013-05-05"
type_ = "Lunch"
content = "Swedish Meatballs"
hasinfo = True
info = "Contains meat"
You can’t perform that action at this time.