[Evergreen-general] Images from URLS in MARC records?
Josh Stompro
stomproj at gsuite.larl.org
Wed Jan 3 15:10:25 EST 2024
If I was going to tackle this as a one off project, and wanted to make use
of existing functionality, I would get a list of all the bibs and image
urls, and then make use of a bash script or regular expressions to download
all the images, name them with the bib id and save them in the proper place
on the server to be served up for each record. Basically what the image
uploader does, just in batch.
There is a section in the documentation that describes how to do this in
general.
https://docs.evergreen-ils.org/docs/latest/admin_initial_setup/designing_your_catalog.html#_including_locally_hosted_content_in_your_public_interface
I'm not sure what the data looks like, so I'm not sure how you would get it
out. Reporter, or SQL, or maybe even marc edit if you have the source marc
files. This could be part of the process for adding new Kanopy bibs if you
don't have it automated. And if you do have it automated, then maybe this
process could get added to the import process.
The data could look like this:
Bibid, small URL, Medium URL, Large URL
1234, http://kcdn.com/small.jpg, http://kcdn.com/medium.jpg,
http://kcdn.com/large.jpg
This could be done with regexes in notepad++ also, to turn the list into a
series of commands to grab the files and rename them. If you want to do
this on your local windows machine, you can use powershell which has a
built in wget command.
Find and Replace in notepad++ with the CSV data loaded:
Description: This splits the CSV data up into 4 components, then uses the
data to build 3 different wget commands to grab each sized image.
Find: (\d+), (.*), (.*), (.*)
Replace: wget "\2" -outfile small/r/\1\nwget "\3" -outfile
medium/r/\1\nwget "\4" -outfile large/r/\1\n
Result:
wget "http://kcdn.com/small.jpg" -outfile small/r/1234
wget "http://kcdn.com/medium.jpg" -outfile medium/r/1234
wget "http://kcdn.com/large.jpg" -outfile large/r/1234
#Start Powershell
#Do this in your downloads folder and create the folders before running the
commands.
cd Downloads
mkdir kanopy-images
cd kanopy-images
mkdir small
mkdir small/r
mkdir medium
mkdir medium/r
mkdir large
mkdir large/r
wget "http://kcdn.com/small.jpg" -outfile small/r/1234
... 30000 more commands to download files.
Now you will have 3 directories with 10K images in each, named for the bib
id number. You can zip those up, send them to your Evergreen server
administrator, and ask that they be placed on the Evergreen server.
On the evergreen server the files need to be copied
to /openils/var/web/opac/extras/ac/jacket/small/r/ for the small images for
example.
Josh
On Wed, Jan 3, 2024 at 11:45 AM Mary Llewellyn via Evergreen-general <
evergreen-general at list.evergreen-ils.org> wrote:
> Hi Terran,
>
> Yes, 10s of thousands of records. I'm not surprised to hear there's no way
> to do this automatically, but I was hoping there was some way I didn't know
> about.
>
> Thanks for the Launchpad suggestion. I will have to do that.
>
> Mary
>
> On Wed, Jan 3, 2024 at 12:09 PM Terran McCanna via Evergreen-general <
> evergreen-general at list.evergreen-ils.org> wrote:
>
>> You could use the image uploader, but if there are thousands of records
>> that would be burdensome.
>>
>> It sounds like a good wish list request in Launchpad.
>>
>> Terran McCanna, PINES Program Manager
>> ------------------------------
>>
>> Georgia Public Library Service | University System of Georgia
>>
>> 2872 Woodcock Blvd, Suite 250 l Atlanta, GA 30341
>>
>> (404) 235-7138 | tmccanna at georgialibraries.org
>>
>> http://help.georgialibraries.org | help at georgialibraries.org
>>
>> <https://www.facebook.com/georgialibraries>
>> <https://www.twitter.com/georgialibs>
>> <https://www.instagram.com/georgialibraries/>
>> <https://www.twitter.com/georgialibs>
>>
>> Join our email list <http://georgialibraries.org> for stories of Georgia
>> libraries making an impact in our communities.
>>
>>
>>
>> On Wed, Jan 3, 2024 at 11:57 AM Mary Llewellyn via Evergreen-general <
>> evergreen-general at list.evergreen-ils.org> wrote:
>>
>>> So, we have these records I loaded for a few libraries from Kanopy. They
>>> don't have ISBNs or UPCs so they don't link to Syndetics. The records do
>>> have URLs pointing to jpgs from Kanopy, but you have to click on the links
>>> to see the images. One of our librarians would like the images to
>>> automatically display in the catalog with the records without having to
>>> click on the link. That sounds like a database/programming issue to me, if
>>> it's at all possible.
>>>
>>> Mary
>>>
>>>
>>> --
>>> Mary Llewellyn
>>> Database Manager
>>> Bibliomation, Inc.
>>> 24 Wooster Ave.
>>> Waterbury, CT 06708
>>> mllewell at biblio.org
>>> _______________________________________________
>>> Evergreen-general mailing list
>>> Evergreen-general at list.evergreen-ils.org
>>> http://list.evergreen-ils.org/cgi-bin/mailman/listinfo/evergreen-general
>>>
>> _______________________________________________
>> Evergreen-general mailing list
>> Evergreen-general at list.evergreen-ils.org
>> http://list.evergreen-ils.org/cgi-bin/mailman/listinfo/evergreen-general
>>
>
>
> --
> Mary Llewellyn
> Database Manager
> Bibliomation, Inc.
> 24 Wooster Ave.
> Waterbury, CT 06708
> mllewell at biblio.org
> _______________________________________________
> Evergreen-general mailing list
> Evergreen-general at list.evergreen-ils.org
> http://list.evergreen-ils.org/cgi-bin/mailman/listinfo/evergreen-general
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.evergreen-ils.org/pipermail/evergreen-general/attachments/20240103/eb4b92e4/attachment-0001.htm>
More information about the Evergreen-general
mailing list