a wish for events #3

Closed
opened 3 years ago by ccl · 14 comments
ccl commented 3 years ago
Owner

a location to show events related to the library...
maybe by category?
eg: Read & Repair, Bibliotecha, maybe others?

thinking of reading club sites...
https://rupert.lt/
https://salwafoundation.nl/
https://www.stroom.nl/paginas/pagina.php?pa_id=4918149

a location to show events related to the library... maybe by category? eg: Read & Repair, Bibliotecha, maybe others? thinking of reading club sites... https://rupert.lt/ https://salwafoundation.nl/ https://www.stroom.nl/paginas/pagina.php?pa_id=4918149
Owner

I think in an ideal world,
the r&r events are made in md format, and made into html by pelican.
Its better to be able to also port these MD files into the library page, so you don't have to make an announcement 3 times, where one is in a completely different format.
but I don't know if there is a way to do only that and not become a full blown pelican. (currently this project is very small and precise and not a big unruly beast like pelican)

In another way, we can keep the r&r events on the library page to be reflective instead of an announcement. (written afterwards)
The goal of this page should be to showcase what we have in the library so people are more inclined to read.
Its relatively easy to include a few books from the csv on a page with a text.

Those are just my thoughts for now.

I think in an ideal world, the r&r events are made in md format, and made into html by pelican. Its better to be able to also port these MD files into the library page, so you don't have to make an announcement 3 times, where one is in a completely different format. but I don't know if there is a way to do only that and not become a full blown pelican. (currently this project is very small and precise and not a big unruly beast like pelican) In another way, we can keep the r&r events on the library page to be reflective instead of an announcement. (written afterwards) The goal of this page should be to showcase what we have in the library so people are more inclined to read. Its relatively easy to include a few books from the csv on a page with a text. Those are just my thoughts for now.
ccl commented 3 years ago
Poster
Owner

Happy to brainstorm together how we could do that.
Thinking of:

  • the RSS feed of the Varia site (maybe filtering the R&R category)
  • the RSS of a Mastodon account for R&R/the R&R hashtag
  • implementing the same system as the books: adding events in a separate spreadsheet where we add: title, description, date, time, guest

And this could be applied also for Bibliotecha events etc...
Going to keep thinking about it...

Happy to brainstorm together how we could do that. Thinking of: - the RSS feed of the Varia site (maybe filtering the R&R category) - the RSS of a Mastodon account for R&R/the R&R hashtag - implementing the same system as the books: adding events in a separate spreadsheet where we add: title, description, date, time, guest And this could be applied also for Bibliotecha events etc... Going to keep thinking about it...
ccl changed title from a wish... to a wish for events 3 years ago
Owner

the RSS feed of the Varia site (maybe filtering the R&R category)

From the NL feed, for example, I did:

$ apt install python3-feedparser

And then:

>>> from feedparser import parse
>>> from pprint import pprint
>>> feed = parse("https://varia.zone/feeds/all-nl.rss.xml")
>>> pprint([entry.title for entry in feed.entries if "Read & Repair" in entry.title])
['Read & Repair feat. Minimal Viable Learning',
 'Read & Repair feat. Christina Karagianni en Anita Hrnić',
 'Read & Repair - Neoliberalism with Dutch Characteristics: The Big Fix Up of '
 'the Netherlands and the Practice of Embedded Cultural Activism',
 'Read & Repair - The Means of Communication as a Means of Production',
 'Read & Repair feat. stone throw - sessie 1',
 'Read & Repair feat. stone throw - sessie 2',
 'Read & Repair feat. Digital Solidarity Networks',
 'Read & Repair feat. Deaf Republic Reading',
 'Read & Repair feat. readings & listings: open licenses edition',
 'Read & Repair feat. The Bootleg Library']

So, that seems very doable! More API stuff @ https://feedparser.readthedocs.io.

> the RSS feed of the Varia site (maybe filtering the R&R category) From [the NL feed](https://varia.zone/feeds/all-nl.rss.xml), for example, I did: ```bash $ apt install python3-feedparser ``` And then: ```python >>> from feedparser import parse >>> from pprint import pprint >>> feed = parse("https://varia.zone/feeds/all-nl.rss.xml") >>> pprint([entry.title for entry in feed.entries if "Read & Repair" in entry.title]) ['Read & Repair feat. Minimal Viable Learning', 'Read & Repair feat. Christina Karagianni en Anita Hrnić', 'Read & Repair - Neoliberalism with Dutch Characteristics: The Big Fix Up of ' 'the Netherlands and the Practice of Embedded Cultural Activism', 'Read & Repair - The Means of Communication as a Means of Production', 'Read & Repair feat. stone throw - sessie 1', 'Read & Repair feat. stone throw - sessie 2', 'Read & Repair feat. Digital Solidarity Networks', 'Read & Repair feat. Deaf Republic Reading', 'Read & Repair feat. readings & listings: open licenses edition', 'Read & Repair feat. The Bootleg Library'] ``` So, that seems very doable! More API stuff @ https://feedparser.readthedocs.io.
Owner
Something is cooking... > https://git.vvvvvvaria.org/varia/varia-library-website/src/branch/master/library/rnrfeed/rnrfeeder.py
rra commented 3 years ago

Awesome! It is also possible btw to enable generating feeds for categories in pelican, less parsing and the post titles do not necessarily need to be called 'Read and Repair' that way: https://docs.getpelican.com/en/stable/settings.html?highlight=feeds#feed-settings

Awesome! It is also possible btw to enable generating feeds for categories in pelican, less parsing and the post titles do not necessarily need to be called 'Read and Repair' that way: https://docs.getpelican.com/en/stable/settings.html?highlight=feeds#feed-settings
Owner

with 8d80bb7c17 I made a page that shows the read and repair category >readrepair/category>
events, from the past.

My next questions are:

  1. Can we have a field in the RSS (I know nothing about RSS feeds except for consuming them) that has the date of the event. similar to lastBuildDate>Tue, 26 Jan 2021 10:22:21 +0100/lastBuildDate>. That way I can make an upcoming event page too.

  2. Is there a field where we can put some tags relating to the events, we can than use the fields field in the varlib.csv to generate a list of links for further reading.

with 8d80bb7c17 I made a page that shows the read and repair category >readrepair/category> events, from the past. My next questions are: 1. Can we have a field in the RSS (I know nothing about RSS feeds except for consuming them) that has the date of the event. similar to lastBuildDate>Tue, 26 Jan 2021 10:22:21 +0100/lastBuildDate>. That way I can make an upcoming event page too. 2. Is there a field where we can put some tags relating to the events, we can than use the fields field in the varlib.csv to generate a list of links for further reading.
Owner

Very nice!

(I know nothing about RSS feeds except for consuming them)

So, the short of creating them is that Pelican generates them from the content in the event posts in the varia.website repository and uses the file metadata (stuff at the top of the file) to add additional data like categories.

Can we have a field in the RSS that has the date of the event.

Can you use event_start? For example, event_start: 2020-04-26 10:30 in https://git.vvvvvvaria.org/varia/varia.website/raw/branch/master/content/r&r-apr-EN.md.

Is there a field where we can put some tags relating to the events, we can than use the fields field in the varlib.csv to generate a list of links for further reading.

Pelican supports a tags field. See https://docs.getpelican.com/en/3.6.3/content.html#file-metadata. So, we just add a tags: ... to each event markdown file and then they will be available.

Very nice! > (I know nothing about RSS feeds except for consuming them) So, the short of creating them is that Pelican generates them from the content in the event posts in the varia.website repository and uses the file metadata (stuff at the top of the file) to add additional data like categories. > Can we have a field in the RSS that has the date of the event. Can you use `event_start`? For example, `event_start: 2020-04-26 10:30` in https://git.vvvvvvaria.org/varia/varia.website/raw/branch/master/content/r&r-apr-EN.md. > Is there a field where we can put some tags relating to the events, we can than use the fields field in the varlib.csv to generate a list of links for further reading. Pelican supports a `tags` field. See https://docs.getpelican.com/en/3.6.3/content.html#file-metadata. So, we just add a `tags: ...` to each event markdown file and then they will be available.
Owner

Oh wait, right, it seems those metadata values are not getting pushed into the RSS field! I guess we need to fiddle with the RSS generation side then to include some extra info.

Oh wait, right, it seems those metadata values are not getting pushed into the RSS field! I guess we need to fiddle with the RSS generation side then to include some extra info.
Owner

Tags become additional categories. As you can see here with the latest R&R event.
http://varia.zone/en/feeds/all-en.rss.xml

The event start I can get by BeautifulSouping the Link of the RSS item and getting class="article-event-start" content. Thats less ideal but I think for now a better solution than hacking the core of pelican as thought of in https://git.vvvvvvaria.org/varia/varia.website/issues/4

let me know what you think

Tags become additional categories. As you can see here with the latest R&R event. http://varia.zone/en/feeds/all-en.rss.xml The event start I can get by BeautifulSouping the Link of the RSS item and getting class="article-event-start" content. Thats less ideal but I think for now a better solution than hacking the core of pelican as thought of in https://git.vvvvvvaria.org/varia/varia.website/issues/4 let me know what you think
rra commented 3 years ago

event_start is non-standard pelican unfortunately as it is part of the events plugin.

If it is just about getting upcoming dates for these read & repair events, I'd just add that information in the post itself and then extract from the RSS body?

Or even better (in case you want to do it for all events), make the events plugin write that information in to the generated html of the post. That way it also makes its way in to the RSS.

event_start is non-standard pelican unfortunately as it is part of the `events` plugin. If it is just about getting upcoming dates for these read & repair events, I'd just add that information in the post itself and then extract from the RSS body? Or even better (in case you want to do it for all events), make the events plugin write that information in to the generated html of the post. That way it also makes its way in to the RSS.
Owner

Aha, wonderful! We can do this from the events already it seems. I was definitely not wanting to do anything to do with hacking Pelican core indeed...and adding stuff to the body seemed workable but also potentially fragile. Here is some code to pull the event_start out of the existing events.ics file! Whatcha think?

$ pip install requests icalendar
$ python3

And then

>>> from requests import get
>>> from icalendar import Calendar
>>> ics = get("https://varia.zone/events.ics").text
>>> gcal = Calendar.from_ical(ics)
>>> [c.get("dtstart").dt for c in gcal.walk() if c.name == "VEVENT" and "Read & Repair" in c.get("summary")]
[datetime.datetime(2020, 7, 26, 14, 0), datetime.datetime(2020, 12, 13, 11, 0), datetime.datetime(2020, 8, 30, 11, 0), datetime.datetime(2020, 6, 28, 15, 0), datetime.datetime(2020, 10, 25, 10, 30), datetime.datetime(2020, 12, 13, 11, 0), datetime.datetime(2021, 1, 31, 10, 30), datetime.datetime(2021, 1, 31, 10, 30), datetime.datetime(2020, 9, 27, 11, 0), datetime.datetime(2020, 2, 23, 11, 0), datetime.datetime(2020, 6, 28, 15, 0), datetime.datetime(2020, 2, 23, 11, 0), datetime.datetime(2020, 4, 26, 10, 30), datetime.datetime(2020, 7, 23, 16, 0), datetime.datetime(2020, 7, 23, 16, 0), datetime.datetime(2020, 1, 26, 11, 0), datetime.datetime(2020, 4, 26, 10, 30), datetime.datetime(2020, 7, 26, 14, 0), datetime.datetime(2020, 1, 26, 11, 0), datetime.datetime(2020, 10, 25, 10, 30), datetime.datetime(2020, 8, 30, 11, 0), datetime.datetime(2020, 9, 27, 11, 0)]
Aha, wonderful! We can do this from the events already it seems. I was definitely not wanting to do anything to do with hacking Pelican core indeed...and adding stuff to the body seemed workable but also potentially fragile. Here is some code to pull the `event_start` out of the existing `events.ics` file! Whatcha think? ```bash $ pip install requests icalendar $ python3 ``` And then ```python >>> from requests import get >>> from icalendar import Calendar >>> ics = get("https://varia.zone/events.ics").text >>> gcal = Calendar.from_ical(ics) >>> [c.get("dtstart").dt for c in gcal.walk() if c.name == "VEVENT" and "Read & Repair" in c.get("summary")] [datetime.datetime(2020, 7, 26, 14, 0), datetime.datetime(2020, 12, 13, 11, 0), datetime.datetime(2020, 8, 30, 11, 0), datetime.datetime(2020, 6, 28, 15, 0), datetime.datetime(2020, 10, 25, 10, 30), datetime.datetime(2020, 12, 13, 11, 0), datetime.datetime(2021, 1, 31, 10, 30), datetime.datetime(2021, 1, 31, 10, 30), datetime.datetime(2020, 9, 27, 11, 0), datetime.datetime(2020, 2, 23, 11, 0), datetime.datetime(2020, 6, 28, 15, 0), datetime.datetime(2020, 2, 23, 11, 0), datetime.datetime(2020, 4, 26, 10, 30), datetime.datetime(2020, 7, 23, 16, 0), datetime.datetime(2020, 7, 23, 16, 0), datetime.datetime(2020, 1, 26, 11, 0), datetime.datetime(2020, 4, 26, 10, 30), datetime.datetime(2020, 7, 26, 14, 0), datetime.datetime(2020, 1, 26, 11, 0), datetime.datetime(2020, 10, 25, 10, 30), datetime.datetime(2020, 8, 30, 11, 0), datetime.datetime(2020, 9, 27, 11, 0)] ```
mb commented 3 years ago
Owner

Nice thread here :)

Re: enabling RSS feeds for categories and tags: it should be possible. I tried to enable them locally, but got stuck at generating them for both NL and EN. The {lang} variable is causing an error...

And by default you only get the NL feeds as that is the default language of the website.

Also, we still use Pelican 3, but installing Pelican 4 didn't help either. Hmm!

https://docs.getpelican.com/en/latest/settings.html#translations

Nice thread here :) Re: enabling RSS feeds for categories and tags: it should be possible. I tried to enable them locally, but got stuck at generating them for both NL and EN. The `{lang}` variable is causing an error... And by default you only get the NL feeds as that is the default language of the website. Also, we still use Pelican 3, but installing Pelican 4 didn't help either. Hmm! https://docs.getpelican.com/en/latest/settings.html#translations
Owner

Also, we still use Pelican 3

Ah you'll be pleased to hear the upgrade work was done recently 🚀 the site is much easier to hack on nowadays https://git.vvvvvvaria.org/varia/varia.website#hackity-hack-hack

> Also, we still use Pelican 3 Ah you'll be pleased to hear the [upgrade work was done recently](https://git.vvvvvvaria.org/varia/varia.website/src/commit/6bf595f0076964d06ed9ef4bbcc0630442e6e57d/requirements.txt#L6) 🚀 the site is much easier to hack on nowadays https://git.vvvvvvaria.org/varia/varia.website#hackity-hack-hack
Owner

Implementation leads to more elaborate ideas for the future.
But so far we have:

  1. Page shows upcoming or latest events based on the ics start time. with small disclaimer that an event has already been and to check varia.zone for the latest updates.
  2. Books from the library can be recommended using the tags in pelican, if they match the fields in the csv of books. This creates links to these books on the past events page.

closing with commit: a34cc1f634

Implementation leads to more elaborate ideas for the future. But so far we have: 1. Page shows upcoming or latest events based on the ics start time. with small disclaimer that an event has already been and to check varia.zone for the latest updates. 2. Books from the library can be recommended using the tags in pelican, if they match the fields in the csv of books. This creates links to these books on the past events page. closing with commit: a34cc1f634
crunk closed this issue 3 years ago
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.