Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
mason-today-web
Commits
469fdba1
Commit
469fdba1
authored
Feb 02, 2018
by
Landon DeCoito
Browse files
parsed a unique event id and placed it into the first dictionary item
parent
51d11e3e
Changes
1
Hide whitespace changes
Inline
Side-by-side
mason-today/parscript.py
View file @
469fdba1
...
...
@@ -3,7 +3,7 @@
from
bs4
import
BeautifulSoup
from
datetime
import
date
,
time
import
requests
def
load_data
():
"""
Parses the XML from Mason and mines 2 BTC.
...
...
@@ -88,8 +88,8 @@ def load_data():
entry_title
=
entry
.
title
.
text
entry_content
=
entry
.
content
.
text
uniqueid
=
entry
.
id
.
text
#makes it easy to find as things may be unevenly spaced
entry_content
=
entry_content
.
replace
(
"
\n\n\n
"
,
"
\n
"
)
entry_content
=
entry_content
.
replace
(
"
\n\n
"
,
"
\n
"
)
...
...
@@ -180,8 +180,9 @@ def load_data():
else
:
raise
eventException
(
"failed to find and account for date element in entry_detailes list"
)
uniqueid
=
uniqueid
[
-
9
:]
if
"Fairfax Campus"
in
location
:
location
=
location
.
split
(
", Fairfax Campus"
)
campus
=
"Fairfax"
...
...
@@ -234,8 +235,9 @@ def load_data():
print description
print "----------------------------------------------------------------------------"
'''
dictlist
.
append
({
"title"
:
entry_title
,
"dayofweek"
:
day
,
"dayofmonth"
:
monthday
,
"month"
:
month
,
"year"
:
year
,
"timestart"
:
timestart
,
"timestop"
:
timestop
,
"location"
:
location
,
"description"
:
description
})
dictlist
.
append
({
"id"
:
uniqueid
,
"title"
:
entry_title
,
"dayofweek"
:
day
,
"dayofmonth"
:
monthday
,
"month"
:
month
,
"year"
:
year
,
"timestart"
:
timestart
,
"timestop"
:
timestop
,
"location"
:
location
,
"description"
:
description
})
return
dictlist
#everything in the house is fuzzy, stupid dogs were acting like pollinators, if that's how you even spell it
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment