Initial commit
This commit is contained in:
commit
8b56ead296
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
.DS_Store
|
||||||
|
/dist/
|
||||||
|
node_modules/
|
||||||
|
yarn-error.log
|
1633
1952_soup.html
Normal file
1633
1952_soup.html
Normal file
File diff suppressed because it is too large
Load Diff
59
README.md
Normal file
59
README.md
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
# .\NFLOddsVis
|
||||||
|
|
||||||
|
This is an [Observable Framework](https://observablehq.com/framework/) app. To install the required dependencies, run:
|
||||||
|
|
||||||
|
```
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, to start the local preview server, run:
|
||||||
|
|
||||||
|
```
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
Then visit <http://localhost:3000> to preview your app.
|
||||||
|
|
||||||
|
For more, see <https://observablehq.com/framework/getting-started>.
|
||||||
|
|
||||||
|
## Project structure
|
||||||
|
|
||||||
|
A typical Framework project looks like this:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
.
|
||||||
|
├─ src
|
||||||
|
│ ├─ components
|
||||||
|
│ │ └─ timeline.js # an importable module
|
||||||
|
│ ├─ data
|
||||||
|
│ │ ├─ launches.csv.js # a data loader
|
||||||
|
│ │ └─ events.json # a static data file
|
||||||
|
│ ├─ example-dashboard.md # a page
|
||||||
|
│ ├─ example-report.md # another page
|
||||||
|
│ └─ index.md # the home page
|
||||||
|
├─ .gitignore
|
||||||
|
├─ observablehq.config.js # the app config file
|
||||||
|
├─ package.json
|
||||||
|
└─ README.md
|
||||||
|
```
|
||||||
|
|
||||||
|
**`src`** - This is the “source root” — where your source files live. Pages go here. Each page is a Markdown file. Observable Framework uses [file-based routing](https://observablehq.com/framework/project-structure#routing), which means that the name of the file controls where the page is served. You can create as many pages as you like. Use folders to organize your pages.
|
||||||
|
|
||||||
|
**`src/index.md`** - This is the home page for your app. You can have as many additional pages as you’d like, but you should always have a home page, too.
|
||||||
|
|
||||||
|
**`src/data`** - You can put [data loaders](https://observablehq.com/framework/data-loaders) or static data files anywhere in your source root, but we recommend putting them here.
|
||||||
|
|
||||||
|
**`src/components`** - You can put shared [JavaScript modules](https://observablehq.com/framework/imports) anywhere in your source root, but we recommend putting them here. This helps you pull code out of Markdown files and into JavaScript modules, making it easier to reuse code across pages, write tests and run linters, and even share code with vanilla web applications.
|
||||||
|
|
||||||
|
**`observablehq.config.js`** - This is the [app configuration](https://observablehq.com/framework/config) file, such as the pages and sections in the sidebar navigation, and the app’s title.
|
||||||
|
|
||||||
|
## Command reference
|
||||||
|
|
||||||
|
| Command | Description |
|
||||||
|
| ----------------- | -------------------------------------------------------- |
|
||||||
|
| `npm install` | Install or reinstall dependencies |
|
||||||
|
| `npm run dev` | Start local preview server |
|
||||||
|
| `npm run build` | Build your static site, generating `./dist` |
|
||||||
|
| `npm run deploy` | Deploy your app to Observable |
|
||||||
|
| `npm run clean` | Clear the local data loader cache |
|
||||||
|
| `npm run observable` | Run commands like `observable help` |
|
2389
data/1952.html
Normal file
2389
data/1952.html
Normal file
File diff suppressed because one or more lines are too long
2356
data/1953.html
Normal file
2356
data/1953.html
Normal file
File diff suppressed because one or more lines are too long
2390
data/1954.html
Normal file
2390
data/1954.html
Normal file
File diff suppressed because one or more lines are too long
2356
data/1955.html
Normal file
2356
data/1955.html
Normal file
File diff suppressed because one or more lines are too long
2390
data/1956.html
Normal file
2390
data/1956.html
Normal file
File diff suppressed because one or more lines are too long
2403
data/1957.html
Normal file
2403
data/1957.html
Normal file
File diff suppressed because one or more lines are too long
2403
data/1958.html
Normal file
2403
data/1958.html
Normal file
File diff suppressed because one or more lines are too long
2356
data/1959.html
Normal file
2356
data/1959.html
Normal file
File diff suppressed because one or more lines are too long
3689
data/1960.html
Normal file
3689
data/1960.html
Normal file
File diff suppressed because one or more lines are too long
3985
data/1961.html
Normal file
3985
data/1961.html
Normal file
File diff suppressed because one or more lines are too long
3985
data/1962.html
Normal file
3985
data/1962.html
Normal file
File diff suppressed because one or more lines are too long
4044
data/1963.html
Normal file
4044
data/1963.html
Normal file
File diff suppressed because one or more lines are too long
3985
data/1964.html
Normal file
3985
data/1964.html
Normal file
File diff suppressed because one or more lines are too long
4020
data/1965.html
Normal file
4020
data/1965.html
Normal file
File diff suppressed because one or more lines are too long
4311
data/1966.html
Normal file
4311
data/1966.html
Normal file
File diff suppressed because one or more lines are too long
4407
data/1967.html
Normal file
4407
data/1967.html
Normal file
File diff suppressed because one or more lines are too long
4457
data/1968.html
Normal file
4457
data/1968.html
Normal file
File diff suppressed because one or more lines are too long
4436
data/1969.html
Normal file
4436
data/1969.html
Normal file
File diff suppressed because one or more lines are too long
4128
data/1970.html
Normal file
4128
data/1970.html
Normal file
File diff suppressed because one or more lines are too long
4128
data/1971.html
Normal file
4128
data/1971.html
Normal file
File diff suppressed because one or more lines are too long
4128
data/1972.html
Normal file
4128
data/1972.html
Normal file
File diff suppressed because one or more lines are too long
4128
data/1973.html
Normal file
4128
data/1973.html
Normal file
File diff suppressed because one or more lines are too long
4128
data/1974.html
Normal file
4128
data/1974.html
Normal file
File diff suppressed because one or more lines are too long
4128
data/1975.html
Normal file
4128
data/1975.html
Normal file
File diff suppressed because one or more lines are too long
4338
data/1976.html
Normal file
4338
data/1976.html
Normal file
File diff suppressed because one or more lines are too long
4338
data/1977.html
Normal file
4338
data/1977.html
Normal file
File diff suppressed because one or more lines are too long
4796
data/1978.html
Normal file
4796
data/1978.html
Normal file
File diff suppressed because one or more lines are too long
4796
data/1979.html
Normal file
4796
data/1979.html
Normal file
File diff suppressed because one or more lines are too long
4796
data/1980.html
Normal file
4796
data/1980.html
Normal file
File diff suppressed because one or more lines are too long
4796
data/1981.html
Normal file
4796
data/1981.html
Normal file
File diff suppressed because one or more lines are too long
3362
data/1982.html
Normal file
3362
data/1982.html
Normal file
File diff suppressed because one or more lines are too long
4796
data/1983.html
Normal file
4796
data/1983.html
Normal file
File diff suppressed because one or more lines are too long
4796
data/1984.html
Normal file
4796
data/1984.html
Normal file
File diff suppressed because one or more lines are too long
4796
data/1985.html
Normal file
4796
data/1985.html
Normal file
File diff suppressed because one or more lines are too long
4796
data/1986.html
Normal file
4796
data/1986.html
Normal file
File diff suppressed because one or more lines are too long
4580
data/1987.html
Normal file
4580
data/1987.html
Normal file
File diff suppressed because one or more lines are too long
4796
data/1988.html
Normal file
4796
data/1988.html
Normal file
File diff suppressed because one or more lines are too long
4796
data/1989.html
Normal file
4796
data/1989.html
Normal file
File diff suppressed because one or more lines are too long
4856
data/1990.html
Normal file
4856
data/1990.html
Normal file
File diff suppressed because one or more lines are too long
4856
data/1991.html
Normal file
4856
data/1991.html
Normal file
File diff suppressed because one or more lines are too long
4856
data/1992.html
Normal file
4856
data/1992.html
Normal file
File diff suppressed because one or more lines are too long
4890
data/1993.html
Normal file
4890
data/1993.html
Normal file
File diff suppressed because one or more lines are too long
4856
data/1994.html
Normal file
4856
data/1994.html
Normal file
File diff suppressed because one or more lines are too long
5092
data/1995.html
Normal file
5092
data/1995.html
Normal file
File diff suppressed because one or more lines are too long
5092
data/1996.html
Normal file
5092
data/1996.html
Normal file
File diff suppressed because one or more lines are too long
5092
data/1997.html
Normal file
5092
data/1997.html
Normal file
File diff suppressed because one or more lines are too long
5092
data/1998.html
Normal file
5092
data/1998.html
Normal file
File diff suppressed because one or more lines are too long
5210
data/1999.html
Normal file
5210
data/1999.html
Normal file
File diff suppressed because one or more lines are too long
5210
data/2000.html
Normal file
5210
data/2000.html
Normal file
File diff suppressed because one or more lines are too long
5210
data/2001.html
Normal file
5210
data/2001.html
Normal file
File diff suppressed because one or more lines are too long
5328
data/2002.html
Normal file
5328
data/2002.html
Normal file
File diff suppressed because one or more lines are too long
5328
data/2003.html
Normal file
5328
data/2003.html
Normal file
File diff suppressed because one or more lines are too long
5328
data/2004.html
Normal file
5328
data/2004.html
Normal file
File diff suppressed because one or more lines are too long
5328
data/2005.html
Normal file
5328
data/2005.html
Normal file
File diff suppressed because one or more lines are too long
5328
data/2006.html
Normal file
5328
data/2006.html
Normal file
File diff suppressed because one or more lines are too long
5328
data/2007.html
Normal file
5328
data/2007.html
Normal file
File diff suppressed because one or more lines are too long
5328
data/2008.html
Normal file
5328
data/2008.html
Normal file
File diff suppressed because one or more lines are too long
5328
data/2009.html
Normal file
5328
data/2009.html
Normal file
File diff suppressed because one or more lines are too long
5328
data/2010.html
Normal file
5328
data/2010.html
Normal file
File diff suppressed because one or more lines are too long
5328
data/2011.html
Normal file
5328
data/2011.html
Normal file
File diff suppressed because one or more lines are too long
5328
data/2012.html
Normal file
5328
data/2012.html
Normal file
File diff suppressed because one or more lines are too long
5328
data/2013.html
Normal file
5328
data/2013.html
Normal file
File diff suppressed because one or more lines are too long
5328
data/2014.html
Normal file
5328
data/2014.html
Normal file
File diff suppressed because one or more lines are too long
5328
data/2015.html
Normal file
5328
data/2015.html
Normal file
File diff suppressed because one or more lines are too long
5328
data/2016.html
Normal file
5328
data/2016.html
Normal file
File diff suppressed because one or more lines are too long
5328
data/2017.html
Normal file
5328
data/2017.html
Normal file
File diff suppressed because one or more lines are too long
5328
data/2018.html
Normal file
5328
data/2018.html
Normal file
File diff suppressed because one or more lines are too long
5328
data/2019.html
Normal file
5328
data/2019.html
Normal file
File diff suppressed because one or more lines are too long
5354
data/2020.html
Normal file
5354
data/2020.html
Normal file
File diff suppressed because one or more lines are too long
5596
data/2021.html
Normal file
5596
data/2021.html
Normal file
File diff suppressed because one or more lines are too long
5583
data/2022.html
Normal file
5583
data/2022.html
Normal file
File diff suppressed because one or more lines are too long
5596
data/2023.html
Normal file
5596
data/2023.html
Normal file
File diff suppressed because one or more lines are too long
5557
data/2024.html
Normal file
5557
data/2024.html
Normal file
File diff suppressed because one or more lines are too long
38
observablehq.config.js
Normal file
38
observablehq.config.js
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
// See https://observablehq.com/framework/config for documentation.
|
||||||
|
export default {
|
||||||
|
// The app’s title; used in the sidebar and webpage titles.
|
||||||
|
title: ".\\NFLOddsVis",
|
||||||
|
|
||||||
|
// The pages and sections in the sidebar. If you don’t specify this option,
|
||||||
|
// all pages will be listed in alphabetical order. Listing pages explicitly
|
||||||
|
// lets you organize them into sections and have unlisted pages.
|
||||||
|
// pages: [
|
||||||
|
// {
|
||||||
|
// name: "Examples",
|
||||||
|
// pages: [
|
||||||
|
// {name: "Dashboard", path: "/example-dashboard"},
|
||||||
|
// {name: "Report", path: "/example-report"}
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
// ],
|
||||||
|
|
||||||
|
// Content to add to the head of the page, e.g. for a favicon:
|
||||||
|
head: '<link rel="icon" href="observable.png" type="image/png" sizes="32x32">',
|
||||||
|
|
||||||
|
// The path to the source root.
|
||||||
|
root: "src",
|
||||||
|
|
||||||
|
// Some additional configuration options and their defaults:
|
||||||
|
// theme: "default", // try "light", "dark", "slate", etc.
|
||||||
|
// header: "", // what to show in the header (HTML)
|
||||||
|
// footer: "Built with Observable.", // what to show in the footer (HTML)
|
||||||
|
// sidebar: true, // whether to show the sidebar
|
||||||
|
// toc: true, // whether to show the table of contents
|
||||||
|
// pager: true, // whether to show previous & next links in the footer
|
||||||
|
// output: "dist", // path to the output root for build
|
||||||
|
// search: true, // activate search
|
||||||
|
// linkify: true, // convert URLs in Markdown to links
|
||||||
|
// typographer: false, // smart quotes and other typographic improvements
|
||||||
|
// preserveExtension: false, // drop .html from URLs
|
||||||
|
// preserveIndex: false, // drop /index from URLs
|
||||||
|
};
|
3526
package-lock.json
generated
Normal file
3526
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
20
package.json
Normal file
20
package.json
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"type": "module",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"clean": "rimraf src/.observablehq/cache",
|
||||||
|
"build": "observable build",
|
||||||
|
"dev": "observable preview",
|
||||||
|
"deploy": "observable deploy",
|
||||||
|
"observable": "observable"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@observablehq/framework": "^1.13.1"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"rimraf": "^5.0.5"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
}
|
32
parse_odds.py
Normal file
32
parse_odds.py
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
from bs4 import BeautifulSoup
|
||||||
|
from dateutil.parser import parse
|
||||||
|
import json
|
||||||
|
|
||||||
|
year = 1952
|
||||||
|
|
||||||
|
with open("data/"+str(year)+".html") as fp:
|
||||||
|
soup = BeautifulSoup(fp, 'html.parser')
|
||||||
|
|
||||||
|
start_pos = soup.find(string="1952 Regular Season - Week 1");
|
||||||
|
|
||||||
|
obj = {
|
||||||
|
"games":[]
|
||||||
|
}
|
||||||
|
|
||||||
|
for table in start_pos.find_all_next(class_="soh1"):
|
||||||
|
for child in table.find_all("tbody"):
|
||||||
|
for row in child.find_all("tr"):
|
||||||
|
cells = row.find_all("td")
|
||||||
|
game = {}
|
||||||
|
cursor = 0
|
||||||
|
if parse(cells[1].string).year!=year:
|
||||||
|
cursor = cursor+1
|
||||||
|
game["date"] = cells[cursor+1].string
|
||||||
|
game["at"] = cells[cursor+3].string
|
||||||
|
game["fav"] = cells[cursor+4].string
|
||||||
|
game["score"] = cells[cursor+5].string
|
||||||
|
obj["games"].append(game)
|
||||||
|
|
||||||
|
objson = json.dumps(obj)
|
||||||
|
|
||||||
|
print(objson)
|
11
scrape_odds.py
Normal file
11
scrape_odds.py
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import requests
|
||||||
|
|
||||||
|
for year in range(1957, 2025):
|
||||||
|
URL = "https://www.sportsoddshistory.com/nfl-game-season/?y="+str(year)
|
||||||
|
page = requests.get(URL)
|
||||||
|
|
||||||
|
f = open("data/"+str(year)+".html", "w", encoding="utf-8")
|
||||||
|
f.write(page.text)
|
||||||
|
f.close
|
||||||
|
|
||||||
|
print("Downloaded " + str(year))
|
1
src/.gitignore
vendored
Normal file
1
src/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/.observablehq/cache/
|
5
src/index.md
Normal file
5
src/index.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# .\NFLOddsVis
|
||||||
|
|
||||||
|
This is the home page of your new Observable Framework app.
|
||||||
|
|
||||||
|
For more, see <https://observablehq.com/framework/getting-started>.
|
BIN
src/observable.png
Normal file
BIN
src/observable.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 394 B |
Loading…
x
Reference in New Issue
Block a user