Skip to content

Added an imageUrl to all functional scrapers in Zurich#484

Open
MarkJaroski wants to merge 2 commits into
jakopako:mainfrom
MarkJaroski:imageUrls_zurich_round01
Open

Added an imageUrl to all functional scrapers in Zurich#484
MarkJaroski wants to merge 2 commits into
jakopako:mainfrom
MarkJaroski:imageUrls_zurich_round01

Conversation

@MarkJaroski

Copy link
Copy Markdown
Contributor

I also created issues for the non-functional ones, at least most of them

I also created issues for the non-functional ones, at least most of them

@jakopako jakopako left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for the contribution! I just made two comments, where it looks like resulting image URLs are not the correct ones.

Comment thread config/zurich.yml
selector: h3.h3
all_nodes: true
separator: ", "
- name: imageUrl

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the resulting image url seems a bit weird and doesn't work if you just browse that link directly, e.g.

  "imageUrl": "https://www.moods.ch/data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAoHBwgHBgoICAgLCgoLDhgUDQ0NGhEOFRUVIyEZGiIVFiEaHysjGh0oHRYWJDUlKC0vMjIyGSI4PTcwPCsxMi8BCgsLDg0OHQUFFS8dFhwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vL//AABEIABEAGAMBIgACEQEDEQH/xAAbAAACAQUAAAAAAAAAAAAAAAAABQYBAgMEB//EACQQAAEDAgQHAAAAAAAAAAAAAAIAAQMEBRExQXEGEiEyNDVC/8QAFwEAAwEAAAAAAAAAAAAAAAAAAQIDAP/EABcRAAMBAAAAAAAAAAAAAAAAAAABAgP/2gAMAwEAAhEDEQA/AHdHXNDCRY5JRBxUL3toWf6W21GbxEDaso7TcNzjfhm64cyNojnZ0y41pFQAbasqrFWU5jbYxdsmQspHdiyHuVsPsB3QhNZHMklw8MdkIQihmf/Z",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right. Goskyr doesn't recognize the data: protocol as a URL, so it prepends the base URL. This can be avoided by making it a text field.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed by making it a text field.

Comment thread config/zurich.yml
type: "url"
location:
selector: ".desktop-linkoverlay"
- name: "imageUrl"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the resulting url seems to be the Tonhalle logo, not the event's image, e.g.

  "imageUrl": "https://www.tonhalle-orchester.ch/site/templates/images/TonhalleZurich_Logo_RGB_Schwarz.png",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll check.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed by fetching the banner image from the event page.

@MarkJaroski MarkJaroski changed the title Added an imageUrl to all functional scrapers Added an imageUrl to all functional scrapers in Zurich May 31, 2026
For Moods the fix was to change the type to text, as goskyr doesn't
recognize the URL protocol "data".

For Tonhalle we're now getting the image used as the banner on the event
page, whereas I had lazily settled for the logo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants