Skip to content

Commit 43024d9

Browse files
authored
Merge pull request #1 from stevebritton/master
Keeping Charles busy
2 parents 8c81a53 + 84646d4 commit 43024d9

2 files changed

Lines changed: 30 additions & 4 deletions

File tree

data.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,31 @@ Pulmonary Arterial Hypertension:
198198
company: Actelion
199199
generic: epoprostenol systemic
200200
regex: '[A-Z][A-Z][A-Z]-[0-9][0-9][0-9][0-9][0-9]'
201+
Respiratory - Chronic Obstructive Pulmonary Disease:
202+
bevespi.com:
203+
dates:
204+
20170430:
205+
code: 2047004-3340900
206+
drug:
207+
company: AstraZeneca
208+
generic: formoterol and glycopyrrolate
209+
regex: '[0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
210+
mysymbicort.com:
211+
dates:
212+
20170228:
213+
code: 1945203-3326734
214+
drug:
215+
company: AstraZeneca
216+
generic: budesonide and formoterol
217+
regex: '[0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
218+
startwithanoro.com:
219+
dates:
220+
20170228:
221+
code: 783658R0
222+
drug:
223+
company: GSK
224+
generic: umeclidinium and vilanterol
225+
regex: '[0-9][0-9][0-9][0-9][0-9][0-9][A-Z][0-9]'
201226
Rheumatoid Arthritis:
202227
arava.com:
203228
dates:
@@ -252,6 +277,6 @@ Rheumatoid Arthritis:
252277
20170528:
253278
code: 0026VMV02
254279
drug:
255-
company: Horizon
280+
company: Horizon Pharma
256281
generic: esomeprazole / naproxen systemic
257282
regex: '[0-9][0-9][0-9][0-9][A-Z][A-Z][A-Z][0-9][0-9]'

moai.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def dict_constructor(loader, node):
2929

3030
# find regulatory code changes
3131
for indication in data:
32-
32+
3333
# what indication?
3434
print indication
3535

@@ -41,8 +41,9 @@ def dict_constructor(loader, node):
4141
# get the html
4242
request = urllib2.Request('http://' + website, headers={'User-Agent' : "Moai"})
4343
html_content = urllib2.urlopen(request).read()
44+
4445
# search for the code using the regex defined per website
45-
live_matches = re.findall(data[indication][website]['regex'], html_content);
46+
live_matches = re.findall(data[indication][website]['regex'], re.sub('<[^<]+?>', '', html_content));
4647

4748
# get the most recent date
4849
most_recent_date = data[indication][website]['dates'].keys()[-1]
@@ -109,7 +110,7 @@ def dict_constructor(loader, node):
109110
plt.savefig('data/' + website.replace("/","-") + '.png', bbox_inches='tight')
110111

111112
plt.close('all')
112-
113+
113114
content += '\n| [{0}](http://{0}) | {1} | {2} | ![{3}](data/{3}.png) |'.format(website, data[indication][website]['drug']['company'], data[indication][website]['drug']['generic'], website.replace("/","-"))
114115

115116

0 commit comments

Comments
 (0)