diff --git a/.gitignore b/.gitignore index 6098aeb..31c4439 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,8 @@ output/qr-codes output/icons # Served listings -listings/lp-output +listings/lp-output/* +!listings/lp-output/index.html # Server-side cache cache diff --git a/README.md b/README.md index a9fb70f..d4cb569 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,6 @@ We occassionally accept requests from server operators to de-list whole Communit ## Contact us -To report issues or make suggestions, [file an issue on this repository](https://codeberg.org/gravel/sessioncommunities.online/issues/new) or visit the Web Development Community on [caliban.org](http://sog.caliban.org/r/webdev). +To report issues or make suggestions, [file an issue on this repository](https://codeberg.org/gravel/sessioncommunities.online/issues/new) or [visit the Web Development Community](https://sessioncommunities.online/#webdev+118d) on caliban.org. In case your issue cannot be resolved publicly, contact [gravel](https://codeberg.org/gravel/gravel) on Session as `gravel` (Registered Session ID). diff --git a/languages/README.md b/languages/README.md index 6b073e9..a47a0b9 100644 --- a/languages/README.md +++ b/languages/README.md @@ -28,4 +28,4 @@ $server_languages[] = array( To label a Community, you would search for the `xxxx` suffix (in this case `a03c`) in the [flags file](./language-flags.php) and add the appropriate entry. -If you cannot any labels for this code, copy an existing block from another server & replace the entries with your own. If you have trouble entering language flags on your keyboard, you may find it helpful to copy them from . +If you cannot find any entries for this code, copy an existing block from another server & replace the entries with your own. If you have trouble entering language flags on your keyboard, you may find it helpful to copy them from . diff --git a/listings/listings.ini b/listings/listings.ini index 1a0c8d6..a1b3c14 100644 --- a/listings/listings.ini +++ b/listings/listings.ini @@ -103,4 +103,9 @@ name=18+ Communities rating=nsfw rooms[]=womanbodybeauty+13f6 rooms[]=piao+2cd5 -rooms[]=AINSFW+fc30 \ No newline at end of file +rooms[]=AINSFW+fc30 + +[all] +name=All Communities +rating=unsafe +rooms[]=* \ No newline at end of file diff --git a/listings/lp-output/index.html b/listings/lp-output/index.html new file mode 100644 index 0000000..2d0aef2 --- /dev/null +++ b/listings/lp-output/index.html @@ -0,0 +1,30 @@ + + + + Listing provider by sessioncommunities.online + + +

Community Listing Provider API

+

+ Hi there! +

+

+ This domain isn't meant to be accessed via a browser, + but to provide lists of Communities to Session Messenger, + and looks something like this. +

+

+ If that doesn't phase you, click these links to read more about what this service does: +

+

+ + Session Listing Provider README + +

+

+ + Session Listing Provider Protocol Specification + +

+ + \ No newline at end of file diff --git a/php/generate-listings.php b/php/generate-listings.php index 74290ae..26108ee 100644 --- a/php/generate-listings.php +++ b/php/generate-listings.php @@ -47,8 +47,9 @@ $servers_raw = file_get_contents($ROOMS_FILE); $server_data = json_decode($servers_raw, true); $servers = CommunityServer::from_details_array($server_data); + $rooms_all = CommunityServer::enumerate_rooms($servers); $rooms_by_id = []; - foreach (CommunityServer::enumerate_rooms($servers) as $room) { + foreach ($rooms_all as $room) { $rooms_by_id[$room->get_room_identifier()] = $room; } $sogs_by_pubkey = []; @@ -58,8 +59,13 @@ $listings = []; foreach ($listings_raw as $id => $listing_props) { $rooms = []; + // TODO: Blocklist option if (isset($listing_props['rooms'])) { foreach ($listing_props['rooms'] as $room_id) { + if ($room_id == '*') { + $rooms = $rooms_all; + break; + } if (isset($rooms_by_id[$room_id])) { $rooms[] = $rooms_by_id[$room_id]; } else {