Skip to content
This repository has been archived by the owner on Jul 5, 2022. It is now read-only.

Add fireside-scraper that pulls all JB episodes #30

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

kbondarev
Copy link

The section in README.md has a detailed explanation

Sorry for the very large one commit, instead of breaking this whole thing into smaller commits which would've been more understandable.

The section in README.md has a detailed explanation
@kbondarev
Copy link
Author

Closes #21

@thebiblelover7
Copy link

thebiblelover7 commented Jun 28, 2022

In episode 434 of coder radio, one of the tags has quotation marks which makes hugo bug out and fail to build. Is there a way to remove the quote or escape them by the scraper automatically?

Also, I get some errors regarding .guests.username:

Start building sites …
hugo v0.92.2+extended linux/amd64 BuildDate=2022-02-23T16:47:50Z VendorInfo=ubuntu:0.92.2-1
ERROR 2022/06/28 12:42:40 render of "page" failed: execute of template failed: template: episode/single.html:51:25: executing "main" at <partial "guests/small.html" (dict "context" . "guest" $guest)>: error calling partial: "/build/themes/jb/layouts/partials/guests/small.html:3:30": execute of template failed: template: partials/guests/small.html:3:30: executing "partials/guests/small.html" at <.guest.username>: nil pointer evaluating interface {}.username
ERROR 2022/06/28 12:42:40 render of "page" failed: execute of template failed: template: episode/single.html:51:25: executing "main" at <partial "guests/small.html" (dict "context" . "guest" $guest)>: error calling partial: "/build/themes/jb/layouts/partials/guests/small.html:3:30": execute of template failed: template: partials/guests/small.html:3:30: executing "partials/guests/small.html" at <.guest.username>: nil pointer evaluating interface {}.username
ERROR 2022/06/28 12:42:40 render of "page" failed: execute of template failed: template: episode/single.html:72:23: executing "main" at <partial "sponsor/small.html" (dict "context" . "sponsor" $sponsor)>: error calling partial: "/build/themes/jb/layouts/partials/sponsor/small.html:4:26": execute of template failed: template: partials/sponsor/small.html:4:26: executing "partials/sponsor/small.html" at <.sponsor.link>: nil pointer evaluating interface {}.link
ERROR 2022/06/28 12:42:40 render of "page" failed: execute of template failed: template: episode/single.html:72:23: executing "main" at <partial "sponsor/small.html" (dict "context" . "sponsor" $sponsor)>: error calling partial: "/build/themes/jb/layouts/partials/sponsor/small.html:4:26": execute of template failed: template: partials/sponsor/small.html:4:26: executing "partials/sponsor/small.html" at <.sponsor.link>: nil pointer evaluating interface {}.link
Error: Error building site: failed to render pages: render of "page" failed: execute of template failed: template: episode/single.html:51:25: executing "main" at <partial "guests/small.html" (dict "context" . "guest" $guest)>: error calling partial: "/build/themes/jb/layouts/partials/guests/small.html:3:30": execute of template failed: template: partials/guests/small.html:3:30: executing "partials/guests/small.html" at <.guest.username>: nil pointer evaluating interface {}.username
Total in 62538 ms

Outside of that, this looks great honestly! Great job!

@StefanS-O
Copy link
Owner

Sorry i merged it due to conflict locally

@kbondarev
Copy link
Author

In episode 434 of coder radio, one of the tags has quotation marks which makes hugo bug out and fail to build. Is there a way to remove the quote or escape them by the scraper automatically?

Also, I get some errors regarding .guests.username:

@thebiblelover7 Yep, I saw those issues as well. I didn't have enough time to test it all the way. I'll fix it all soon :))

Sorry i merged it due to conflict locally

@StefanS-O not a problem at all. There are still a few things need to be polished before it's actually ready to merge into master. I created the pull-request mainly to show the progress and get some feedback to understand if I'm going into the right direction
I'll make sure to get it all ready for merge with no conflicts, and will let you know here when I think it is ready.

@StefanS-O
Copy link
Owner

@kbondarev: Nice!

@thebiblelover7: i think the template needs to get better and be less fragile. I will look into it.

@kbondarev
Copy link
Author

I still have some issues when huge tries to build to all the data. It's the error that @thebiblelover7 mentions with .guests.username...

Huge error's aren't that descriptive, but I think what happens is that one of the episodes is referencing a Guest that doesn't exist. I started writing a small script to read all the guests/hosts in the episodes and the one's that defined in data folder to try to find who's missing.

But it also might be an issue with the template itself, as you said @StefanS-O .

I don't know much about the language/syntax hugo uses so it might take some digging into the docs :) But maybe any of you can answer this quicker:
Is there some way to "null check" for guests/hosts/sponsors in the template before accessing them? And maybe also make it log a message saying something like "The file content/coderradio/123.md referencing undefined 'guest: theusernameoftheguesthere`"? That would be very helpful to troubleshoot.

I will try to look into doing all that today at night (EDT).

@StefanS-O
Copy link
Owner

@kbondarev i fixed this error with this commit: 0c26b6d

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants