Commit 4315326c authored by Vicky Steeves's avatar Vicky Steeves 👽

Merge branch 'scripts-hash' into 'master'

Scripts hash

See merge request !8
parents fa860b1e 1ad6bbe5
Pipeline #9418517 passed with stages
in 2 minutes and 2 seconds
# This file is a template, and might need editing before it works on your project.
# Full project: https://gitlab.com/pages/plain-html
image: "python:2"
stages:
- test
- deploy
check:
stage: test
script:
- python checkcsv.py data/women-leaders-openness.csv
pages:
stage: deploy
script:
- mkdir .public
- cp -r * .public
- cp -r * .public/
- mv .public public
- "sed 's/\\( csv_path *[:=] *[\"'\\'']data\\/women-leaders-openness\\.csv\\)\\([\"'\\'']\\)/\\1?h='$(git rev-parse --short HEAD)'\\2/' index.html >public/index.html"
- "sed 's/\\( csv_path *[:=] *[\"'\\'']data\\/women-leaders-openness\\.csv\\)\\([\"'\\'']\\)/\\1?h='$(git rev-parse --short HEAD)'\\2/' map.html >public/map.html"
artifacts:
paths:
- public
only:
- master
\ No newline at end of file
- master
#!/usr/bin/env python
import csv
import re
import sys
def error(msg, line):
sys.stderr.write(msg)
sys.stderr.write(" line %d\n" % (line + 1))
sys.exit(1)
_twitter = re.compile(r'^(@[a-zA-Z0-9_]{1,15})?$')
_coord = re.compile(r'^-?[0-9]{1,3}\.[0-9]{1,10}$')
if __name__ == '__main__':
with open(sys.argv[1]) as fp:
cols = None
for line, row in enumerate(csv.reader(fp)):
if line == 0:
cols = len(row)
continue
if len(row) != cols:
error("Invalid number of columns", line)
if not _twitter.match(row[1]):
error("Invalid Twitter handle %r" % row[1], line)
if not _coord.match(row[3]):
error("Invalid latitude %r" % row[3], line)
if not _coord.match(row[4]):
error("Invalid longitude %r" % row[4], line)
print("Validated %d entries" % line)
......@@ -77,7 +77,7 @@ Carmen Mitchell,@carmendarlene,California State University,34.0667886,-118.16809
Carol Chiodo,@digitaldante,Yale,41.3163244,-72.9223431
Carol Hixson,,Florida Atlantic University,26.1197351,-80.1411818
Carol Willing,,Python Software Foundation,39.7299627,-75.564504
Carole Goble,@CaroleAnneGoble ,Manchester University,41.0114193,-85.759772
Carole Goble,@CaroleAnneGoble,Manchester University,41.0114193,-85.759772
Carole Paleco,,Royal Belgian Institute of Natural Sciences,50.8365453,4.3767912
Carolina Botero,@carobotero,Creative Commons Colombia,4.6486259,-74.2478946
Carolyn Mills,,University of Connecticut,41.8077414,-72.2539805
......@@ -94,7 +94,7 @@ Cheryl Ball,@s2ceball,West Virginia University,39.6361396,-79.9559358
Cheryl Hodgkinson-Williams,@cherylHW,University of Cape Town/ROER4D,-33.957652,18.4611991
Chloe Furnival,@ChloeFurnival1,Federal University of São Carlos,-21.9841446,-47.8802454
Chris Banks,@ChrisBanks,Imperial College,51.4987997,-0.1748772
Chris Bourg,@mchris4duke ,MIT,42.360091,-71.09416
Chris Bourg,@mchris4duke,MIT,42.360091,-71.09416
Chris Gunter,@girlscientist,Emory University School of Medicine,33.7939674,-84.3218135
Christie Koehler,,NumFOCUS,30.442344,-97.769885
Christina Bergmann,@chbergma,Ecole Normale Superieure Paris,48.8422058,2.3451689
......@@ -208,7 +208,7 @@ Jane Burns,@JMBurns99,University College Dublin,53.3053439,-6.2206539
Jane Park,,Creative Commons,29.513686,-98.362149
Jaron Porciello,,Cornell University,42.4534492,-76.4735027
Jasmine Roberts,@ProfJasmine,Ohio State University,40.0141905,-83.0309143
Jen Waller,@jenniferwaller ,University of Oklahoma,35.205898,-97.4479024
Jen Waller,@jenniferwaller,University of Oklahoma,35.205898,-97.4479024
Jenifer Bartle,,Wellesley College,42.2935733,-71.3059277
Jennifer Beamer,@jenbeamer,University of Hawaii at Manoa,21.296939,-157.8171118
Jennifer Chan,,UCLA,34.068921,-118.4451811
......@@ -425,7 +425,7 @@ Samantha Hindle,,UCSF,37.7631333,-122.4575489
Sandra Collins,@SandriCollins,National Library of Ireland,53.3408879,-6.2523874
Sandra Miguel,,Universidad Nacional de La Plata,-34.9128818,-57.9511217
Sara Bowman,,Center for Open Science,38.0318841,-78.4841551
Sara Fratti,@fratticidio ,Guatemala Creative Commons,14.6068732,-90.507595
Sara Fratti,@fratticidio,Guatemala Creative Commons,14.6068732,-90.507595
Sara Grimme,,Heliyon Journal,51.5174787,-0.0958995
Sara Mannheimer,@saramannheimer,Montana State,45.6667557,-111.04981
Sarah Cohen,,Open Textbook Network,44.9777443,-93.239717
......@@ -440,7 +440,7 @@ Sarah Supp,@srsupp,Denison University,40.074025,-82.522643
Sarah Whitcher-Kansa,@OC_Sarah,Alexandria Archive Institute / Open Context,37.7310279,-122.4633128
Sarah Wipperman,,University of Pennsylvania,39.9522188,-75.1932137
Saray Córdoba,@saraycg,Universidad de Costa Rica,9.9369951,-84.0510292
Sarita Albagli,@saritaal ,Instituto Brasileiro de Informação em Ciência,-22.9542193,-43.1746013
Sarita Albagli,@saritaal,Instituto Brasileiro de Informação em Ciência,-22.9542193,-43.1746013
Saskia woutersen-windhouwer,,university of amsterdam,52.3558182,4.9557263
Sely Costa,@svmelton,Universiy of Brasilia,-15.7631573,-47.8706311
Shannon Behrman,@slbehrman,iBiology,37.7631375,-122.4597376
......@@ -452,7 +452,7 @@ Sherri Barnes,,UC Santa Barbara,34.4139629,-119.848947
Sherry Lake,,University of Virginia,38.0335529,-78.5079772
Shilpa Rele,@ShilpaRele,Rowan University Libraries,39.7090928,-75.1190762
Sian Harris,@SianHarris8,INASP ,51.748999,-1.258634
Simine Vazire,@siminevazire ,UC Davis,38.5382322,-121.7617125
Simine Vazire,@siminevazire,UC Davis,38.5382322,-121.7617125
Sonika Tyagi,@tsonika,Australian School of Applied Management,-37.816778,144.955536
Sophie Murray,@sophieannmurray,Trinity College Dublin,53.3437935,-6.2545716
Stacy Konkiel,@skonkiel,Altmetric + ImpactStory,51.5338187,-0.1234566
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment