Skip to content

Instantly share code, notes, and snippets.

@stdavis
Created February 6, 2017 19:05
Show Gist options
  • Select an option

  • Save stdavis/8ecd4fe1899dd47b0f6bbe868ba19caa to your computer and use it in GitHub Desktop.

Select an option

Save stdavis/8ecd4fe1899dd47b0f6bbe868ba19caa to your computer and use it in GitHub Desktop.
Flush Netlify Cache
from os.path import join
from glob import glob
files = [
'a-day-in-the-life-of-utahs-arcgis-server-base-maps',
'about-our-new-v6-website-in-ghpages',
'about/data-policies',
'authoritative-utah-geocoding-results',
'best-practices-document-for-loading-data-into-an-sde',
'data/aerial-photography/2006-hro-1-foot-color-orthophotography',
'data/boundaries',
'data/demographic/2010-census-data',
'data/geoscience/quaternary-faults',
'data/gis-data-sharing',
'data/health',
'data/location/gnis',
'data/location/u-s-postal-service',
'data/recreation/boat-ramps',
'data/sgid-base-map-services-arcmap',
'data/utilities/telephone-infrastructure-and-rural-telcom-boundaries',
'developer/blog',
'esri-jsapi-3-4-and-the-dojo-build-system',
'evolving-utah-sgid-web-services-a-proposal',
'grunt-esri-slurp',
'lidar-2013-2014-wasatch-front-acquisition-update',
'mark-your-calendar-udot-agrc-regional-road-centerline-meetings',
'my-favorite-sublime-text-3-plugins-configs',
'new-utah-political-districts-and-voting-precincts-gis-datasets',
'news',
'plss-corner-management-web-application-redesign',
'progress-update-utah-address-points-gis-layer',
'turn-gps-network-updates',
'ugs-updates-quaternary-faults-data',
'utah-broadband-outreach-center-releases-revamped-availability-map',
'utah-geological-survey-releases-new-interactive-fault-map',
'utah-sgid-statewide-roads-data-layer-updates-10032016',
'utah-sgid-statewide-roads-data-layer-updates-352015',
'utah-sgid-statewide-roads-data-layer-updates-4-15-2016',
'utah-sgid-statewide-roads-data-layer-updates-862015',
'what-is-https-and-should-we-be-using-it'
]
base_folder = r'/Users/stdavis/Documents/Projects/gis.utah.gov'
for f in files:
print(f)
if '/' in f:
file_path = join(base_folder, f, 'index.html')
else:
glob_files = glob('{}/**/*{}*.*'.format(base_folder, f))
if len(glob_files) == 1:
file_path = join(base_folder, glob_files[0])
else:
print('ERROR! glob_files: {}'.format(glob_files))
continue
with open(file_path, 'a') as write_file:
write_file.write(' ')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment