tl; dr: I am looking for a way to find records in our database that lack information, get this information from the website and add it to the database record.
We have a media management program that uses the mySQL table to store information. When employees upload media files (video files, images, audio files) and import them into the media manager, they must also copy the media description (from the source site) and add it to the description in Media Manager. However, this was not done for thousands of files.
The file name (for example, file123 .mov) is unique, and the details page for this file can be obtained by clicking on the URL on the original website:
website.com/content/ file123
The information that we want to clear from this page has an element identifier that is always the same.
In my opinion, the process will be as follows:
- Connect to the database and download the table
- Filter :
"format"
is "Still Image (JPEG)"
- Filter :
"description"
is "NULL"
- Get the first result
- Get
"FILENAME"
without extension) - Download URL : website.com/content/
FILENAME
- Copy the contents of the
"description"
element (on the website) - Paste content into
"description"
(SQL record) - Get a second result
- Rinse and repeat until the last result
My question (s):
- Is there software that could do this, or is it something that needs to be scripted?
- If the script, what will be the best type of script (for example, I can achieve this using AppleScript or it will need to be done in java or php, etc.).
source share