# Files for turning an RSS feed into Iceshrimp.NET Notes ## Introduction: This is a much simpler reworking of the [Mastodon rss-to-toot] scripts Why ? Well, Mastodon had a much lower character count per toot, meaning that several variants had to be created Some toots had to be sent without including say, the RSS 'description' My [Iceshrimp.NET] instance character count per Note allows for much longer posts meaning that only one script is needed ## Prerequisites: * ### Create a new account Obviously you can skip this part if you intend to use an existing account Turn Registrations **ON**: nano iceshrimp.net/Iceshrimp.Backend/configuration.ini ;; Whether to allow instance registrations ;; Options: [Closed, Invite, Open] #Registrations = Closed Registrations = Open Then, in a Terminal send a POST request: curl -X 'POST' \ 'http://localhost:3000/api/iceshrimp/auth/register' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -H 'Host: shrimp.example.org' \ -d '{ "username": "account_name_goes_here", "password": "super_long_password_goes_here" }' The output should be something like this: {"status":"authenticated","isAdmin":false,"isModerator":false,"token":"this_is_the_TOKEN","user":{"id":"9fqw78arpr8rv21m","username":"account_name_goes_here","host":null,"displayName":null,"avatarUrl":"https://shrimp.example.org/identicon/9fqw78arpr8rv21m","bannerUrl":null,"instanceName":"example.org","instanceIconUrl":null}} * #### Make a note of the Authentication TOKEN in the response This bit is the Authentication TOKEN: "token":"this_is_the_TOKEN" Turn Registrations back **OFF**: nano iceshrimp.net/Iceshrimp.Backend/configuration.ini ;; Whether to allow instance registrations ;; Options: [Closed, Invite, Open] Registrations = Closed #Registrations = Open * #### Test the TOKEN works In a Terminal post something to the instance using the TOKEN provided: curl -X 'POST' \ 'https://shrimp.example.org/api/iceshrimp/notes' \ -H 'accept: application/json' \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer this_is_the_TOKEN" \ -d '{ "text": "Test Post", "visibility": "public" }' **Note:** * The 'text' parameter is required * The 'visibility' parameter is required ## Files: The python code takes an RSS feed It takes the latest entry in the feed If that entry is different to the last entry posted to the instance, it crafts an Iceshrimp.NET Note announcing the new feed content, and updates the Iceshrimp.NET timeline The scripts post the following RSS content ('title', 'description', 'link') along with a comment and the hashtags: * ### [bot_all_no_image.py] This will cycle through **all** of the items in the RSS feed * ### [bot_no_image.py] This will post only the **latest** item in the RSS feed * ### [last_note.txt] The text file that contains the ID of the last RSS entry that was posted as a Note * ### [last_rss.txt] The text file that contains the ID of the last RSS entry * ### [secrets.py] The Python file that contains the access Token and other needed connection info