-
-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moving images to v1e.com #421
Comments
I found the list of images with this bash command:
That created a list of 580 lines with images linked from "wp-content". On closer inspection, those all look like valid images from the v1engineering website: |
I created a python script to parse that list of images and download each image to a similar location on my local machine: #!/usr/bin/python3
import os.path
import pathlib
import urllib.request
outdir='img/'
with open('v1_images.txt', 'r') as links:
for line in links:
# Find where the word "uploads/" ends
upload_char = line.find('uploads')+8
# Grab the text after that, until we reach a double quote or a close parenthesis
filename = line[upload_char:].strip().split(')')[0].split('"')[0].strip()
# Use os.path to find the folder name
foldername = os.path.dirname(filename)
# Get the original URL by getting everything until a close parenthesis, and then everything
# back to the open parenthesis, and then cut off anything after the double quote.
original_url = line.split(')')[0].split('(')[-1].split('"')[0].strip()
# Make the directory (should be OS independent. It works in Linux)
pathlib.Path(outdir+foldername).mkdir(parents=True, exist_ok=True)
# Download the url to the output folder
print('downloading: ', url)
urllib.request.urlretrieve(url, filename=outdir+filename) The result is a folder |
This is what I think the next steps are:
|
Fixed in #424 by merging them into this repo. |
Thank you! |
Forum for reference: https://forum.v1e.com/t/website-refresh/34933/90?u=jeffeb3
We have a bunch of images linked in the form:
We need to move those to the new server (at the new URL). The docs should point to something at the new v1e.com site for these images.
I'll use this space to document the steps we're taking, and reference back to this for the final PR.
The text was updated successfully, but these errors were encountered: