Here’s a screenshot of #nostrscript which is currently working inside of damus! This script connects to a specific relay (primal) and fetches their trending data using their custom query. The language im using here is actually AssemblyScript, which compiles to wasm. You can use any programming language in theory to code nostrscripts. Damus executes the wasm binary directly. These scripts will be the engine of custom list views, allowing a very powerful system for pluggable algorithms. You will also be able to broadcasts these scripts to the network, and damus can automatically list and load them, enabling a marketplace of algorithms. image

Replies (39)

Apple explicitly allows shipping Javascript OTA updates to web based apps. I think they just don’t want apps to sneak in usage of restricted native features between review cycles.
These scripts are heavily sandboxed and restricted in what they can do, its fine.
jescala's avatar
jescala 2 years ago
“2.5.2 Apps should be self-contained in their bundles, and may not read or write data outside the designated container area, nor may they download, install, or execute code which introduces or changes features or functionality of the app, including other apps. Educational apps designed to teach, develop, or allow students to test executable code may, in limited circumstances, download code provided that such code is not used for other purposes. Such apps must make the source code provided by the app completely viewable and editable by the user.” 4.7 also talks about the exception for JavaScript.
This compiled code example is like 1000 bytes. ActionScript is great, my only gripe is that they use utf16 strings. Maybe one day ill make my own lang designed for wasm targets, would be fun.
Super cool. One thing to note is that this is not a supported public API. We iterate rapidly with these things (“cache3.primal.net/cache15" 😂), and deprecate obsolete stuff without notice. If there is interest in using these trending feeds, we can look into standing up something with better guarantees that it will stay up. Would love to see trending posts in Damus and generally happy to do it for all app devs who wish to use these feeds.
Right this is why I’m using it as an example script, i would never add this directly in damus since its a custom api that could break. This script could be updated in realtime via plugin updates.
Not sure if this is what you mean but - nostr.band allows for curated feeds from users, via custom relays (like wss://feeds.nostr.band/meme by Tony) - listr.lol for creating lists of people & copying others' lists Coracle has that in-built + allows you to mention relays too; Amethyst allows for switching between Follows/ any list from listr on Home feed -Will's working on nostrscript (don't understand much) that could maybe used for pluggable algos to create feeds i think View quoted note → - Already some RSS feeds of news are on Nostr like Reuters + maybe more View quoted note →