Hey there, it seems like there is an issue with the date filter, here's what I was doing:
I can't reproduce it easily, but it did happen once...
Add 10 biggest instances of https://instances.joinmobilizon.org/instances (in terms of events), without spammy instances.
Note: tags can be further reduced because they are not changed from mobilizon
This is amazing. Thank you for your reactivity !
I'll add the publicly known instances (88 at the moment) at a later time, probably after the release because I will use the extends
thing.
Ok, thanks for the input, I'm 90% there:
{
"https://www.mobilizon.fr": {
"news_rss_url": "https://mobilizon.fr/feed/instance/atom",
"search_url": "https://mobilizon.fr/api",
"search_url_web": "https://mobilizon.fr/search?term={}",
"favicon_url": "https://mobilizon.fr/img/icons/favicon.svg",
"method": "POST",
"type": "JSON",
"search_ctype": "application/json",
"body": "{\"operationName\": \"SearchEventsAndGroups\", \"query\":\"query SearchEventsAndGroups($term: String, $beginsOn: DateTime, $eventPage: Int, $limit: Int) { searchEvents(term: $term, beginsOn: $beginsOn, page: $eventPage, limit: $limit) { total elements { title url beginsOn attributedTo { name } organizerActor { name } picture { url name alt } description } }}\",\"variables\":{\"term\":\"{}\", \"limit\": {#}},\"operationName\":\"SearchEventsAndGroups\"}",
"results": "data.searchEvents.elements",
"r_h1": "title",
"r_url": "url",
"r_dt": "beginsOn",
"r_txt": "description",
"r_by": [
"organizerActor.name",
"attributedTo.name"
],
"r_by_tpl": "$1$2",
"r_img_src": "picture.url",
"r_img_title": "picture.name",
"r_img_alt": "picture.alt",
"tags": {
"name": "Mobilizon",
"lang": "fr",
"country": "fr",
"themes": [
"general"
],
"tech": [
"fast",
"indep."
],
"src_type": [
"Events"
],
"res_type": [
"text"
]
}
}
}
Complete with slug and image. There are a few issues though:
fast
tag but it-is-fast-on-my-machinelang
and country
are relevant, but I guess hacking a press-oriented thing for general events has some dissonance at some pointr_by
, but as I said sometimes one of them is empty so I want to use the other one. Problem: in r_by_tpl
, when one of the fields is null, it becomes "undefined" which is used as is. So with r_by_tpl
being $1$2
, it becomes "undefinedMyOrganizer"Any inputs about those ?
(That definition is usable as-is, but not perfect)
First of all, thank you for this extension !
We met a few days back and as I told you I'd like to add Mobilizon as a kind of source, which should hopefully convince more people to use Mobilizon. Discoverability is, to me, the biggest problem of the decentralized web and I feel like Meta-press.es can be hacked to tackle this problem.
Mobilizon is using GraphQL for its API. This means POSTing a body with a specific structure, and the reply is a JSON.
Here's the blurb in the request:
{"query":"query SearchEventsAndGroups($location: String, $radius: Float, $tags: String, $term: String, $type: EventType, $category: String, $beginsOn: DateTime, $endsOn: DateTime, $eventPage: Int, $limit: Int) {\n searchEvents(location: $location, radius: $radius, tags: $tags, term: $term, type: $type, category: $category, beginsOn: $beginsOn, endsOn: $endsOn, page: $eventPage, limit: $limit) {\n total\n elements {\n title\n url\n beginsOn\n attributedTo {\n name\n }\n organizerActor {\n name\n }\n }\n }\n}\n","variables":{"term":"concert"},"operationName":"SearchEventsAndGroups"}
Basically, a JSON object with a query
field and variables
. The query looks like this when formatted:
query SearchEventsAndGroups($location: String, $radius: Float, $tags: String, $term: String, $type: EventType, $category: String, $beginsOn: DateTime, $endsOn: DateTime, $eventPage: Int, $limit: Int) {
searchEvents(location: $location, radius: $radius, tags: $tags, term: $term, type: $type, category: $category, beginsOn: $beginsOn, endsOn: $endsOn, page: $eventPage, limit: $limit) {
total
elements {
title
url
beginsOn
attributedTo {
name
}
organizerActor {
name
}
}
}
}
(Note: this is not the query used by the actual frontend, which is waaaaaay more complicated. It includes stuff like location, events options etc that might not be relevant for Meta-Press.es)
The reply is a standard JSON:
{
"data": {
"searchEvents": {
"elements": [
{
"attributedTo": null,
"beginsOn": "2022-05-01T19:00:00Z",
"organizerActor": {
"name": "VERO JEAN-LUC"
},
"title": "CONCERTS A VENIR ...",
"url": "https://mobilizon.fr/events/80c84e36-2155-4fa2-a67f-e900ea49cc86"
},
{
"attributedTo": null,
"beginsOn": "2022-10-01T12:00:00Z",
"organizerActor": {
"name": "Alternatiba Rennes"
},
"title": "Weekend des possibles 2022",
"url": "https://mobilizon.fr/events/a114010e-bce1-4547-86e2-d5b230c3c7ed"
},
{
"attributedTo": null,
"beginsOn": "2022-10-01T18:00:00Z",
"organizerActor": {
"name": "Still Freak"
},
"title": "Rudeboy plays Urban Dance Squad en concert @ l'Accordeur",
"url": "https://mobilizon.fr/events/10c25817-3f25-4edc-be04-4293addf77ac"
},
{
"attributedTo": {
"name": "Musique sur Nantes ! :D"
},
"beginsOn": "2022-10-05T17:30:00Z",
"organizerActor": null,
"title": "SCENE OUVERTE MUSICALE au Chat Noir",
"url": "https://mobilizon.fr/events/c11c3a8a-bc32-450d-b33c-ee385eb866ba"
},
{
"attributedTo": null,
"beginsOn": "2022-10-06T16:00:00Z",
"organizerActor": {
"name": "Still Freak"
},
"title": "Cult of Luna + Caspian + Birds In Row ~ Atabal Biarritz",
"url": "https://mobilizon.fr/events/4cc2afc6-7fbb-4b39-ba8b-5770f4130816"
},
{
"attributedTo": null,
"beginsOn": "2022-10-06T16:15:00Z",
"organizerActor": {
"name": "Still Freak"
},
"title": "PUNISH YOURSELF à Toulouse - Pink Paradize 2022",
"url": "https://mobilizon.fr/events/46f6b32a-0597-4c0d-8f56-96d418e172ed"
},
{
"attributedTo": null,
"beginsOn": "2022-10-07T18:45:00Z",
"organizerActor": {
"name": "Will pandarec"
},
"title": "LUNCH + CHEAP ENTERTAINMENT @ [L'INTERMEDIAIRE]",
"url": "https://mobilizon.fr/events/49073407-9c68-4569-98e7-94bf11bbe032"
},
{
"attributedTo": {
"name": "le Plancher des Chèvres"
},
"beginsOn": "2022-10-08T17:30:00Z",
"organizerActor": null,
"title": "OTTILIE [B] COEUR <3 et LOUISE O'SMAN",
"url": "https://mobilizon.fr/events/d03eefd7-368c-457c-9ae1-b0d0cb87b465"
},
{
"attributedTo": {
"name": "Apéros-Discussions SENSIBILIZON Nantes"
},
"beginsOn": "2022-10-22T15:00:00Z",
"organizerActor": null,
"title": "DROITS HUMAINS : ON EN EST OÙ ? Samedi 22/10, 17h-19h",
"url": "https://mobilizon.fr/events/56a8307b-f4e6-439a-a7a7-027b2e429e42"
},
{
"attributedTo": null,
"beginsOn": "2022-10-29T17:30:00Z",
"organizerActor": {
"name": "Still Freak"
},
"title": "Goulamas’K - Resaka Sonora",
"url": "https://mobilizon.fr/events/37f991f8-2b4b-4e10-9362-b72210682064"
}
],
"total": 12
}
}
}
To play with the API, here's a very helpful link targeting the main instance directly: https://mobilizon.fr/graphiql
So, it seems to be pretty straightforward, but there's an issue: as you can see we need to include both organizerActor
and attributedTo
because sometimes one is null and we must use the other. Hence the question: is it possible to indicate two fields and take the first one that is not null ?