How to Automate Updating Arweave Manifests (Websites)

Our open source code will make updating your Arweave RSS feed and website easier.

How to Automate Updating Arweave Manifests (Websites)

Warning: This Guide requires Linux knowledge at an intermediate level


Previous:

As we covered in our previous article, getting your website on Arweave is going to be challenging, especially until more Hugo templates are developed to work in serverless mode.

Updates your Manifest

The Simplified Privacy team has automated updating your website so you do not have to manually search for the dataTxIds and copy paste them over. This is useful for RSS feeds and sites with news.

To do this, we used a Linux and Python script. The code can be found here:
https://git.simplifiedprivacy.is/SimplifiedPrivacy/Arweave-Auto-Manifest-Update

Let’s break down each part.

Python Script = Updating Manifest


The part that’s doing the search and update of the JSON is the python code, to run it you need:
1 - input of the ArDrive upload.
2- what folder you’re uploading in.
3 - where the JSON you’re updating is.

You need 3 arguements:


python3 simple.py {input text file} {folder name} {output json file}  

Arguement 1:

The output from ArDrive is inserted as the input into this program, and it has to be saved as a text file. For example if input.txt is the file then:

python3 simple.py input.txt  

Arguement 2:

Then we include the folder we’re uploading from. So for example if I’m inside a folder named zenaku/

python3 simple.py input.txt zenaku/  

Arguement 3:

And then finally, we include the location of the JSON manifest we’re adding these DataTxIds to:

python3 simple.py input.txt zenaku/ output.json  

This will spit out output-html.json and output-xml.json , which is the index homepage and the RSS feed.

Linux Script = Automate Workflow


So the Linux script is calling upon the Python script and then automating these other parts, so you do not have to run them each time.

However, you do need to put in your folder and wallet locations in the Linux script the first time only. Since you will want to understand what it’s doing to add your folder and wallet names, let’s go through each of the script steps.

a) Uploading the files

Outputing the rawupload1.txt

If we assume your parent folder ID is 34bcd424-d072-414b-ae1b-6ea6c3903355. And your Arweave wallet is /root/wallet-folder/wallet.json (which is NOT in the folder you’re uploading). And you’re inside the folder zenaku. While your wallet file is OUTSIDE the folder you’re uploading.

Warning: do not upload your arweave wallet by mistake.

for i in *; do ardrive upload-file --local-path "$i" --parent-folder-id "34bcd424-d072-414b-ae1b-6ea6c3903355" -w /root/wallet-folder/wallet.json; done > rawupload1.txt  

b) Calling upon the Python (Updating the Json)

Input is rawupload1.txt
Output is output-html.json & output-xml.json

python3 /root/arweave/sep16/zen.py rawupload1.txt zenaku/ output.json  

c) Uploading the Updated JSON

Input is Output is output-html.json & output-xml.json
Output is output2.txt & output3.txt

ardrive upload-file --content-type "application/x.arweave-manifest+json" --local-path output-html.json --parent-folder-id "34bcd424-d072-414b-ae1b-6ea6c3903355" -w /root/wallet-folder/wallet.json > output2.txt  

ardrive upload-file --content-type "application/x.arweave-manifest+json" --local-path output-xml.json --parent-folder-id "34bcd424-d072-414b-ae1b-6ea6c3903355" -w /root/wallet-folder/wallet.json > output3.txt  

d) Update your ArNS

Get the DataTxId from output2.txt and output3.txt and update your DNS


If you really want to learn and take your privacy to the next level, subscribe to our new content via: Session, Nostr, Bastyon, RSS, Ethereum Push

Related Posts

How to Add Arweave RSS to AntennaPod

How to Add Arweave RSS to AntennaPod

Your Existing Podcast App Works

[SP]

Dec 23, 2024

Ditch Government Internet

Ditch Government Internet

DARPA made the current system

[SP]

Dec 22, 2024

Arweave Gateway list

Arweave Gateway list

Get a full list of gateways

[SP]

Dec 18, 2024

Dear Bitcoin Maxis, Rethink Arweave

Dear Bitcoin Maxis, Rethink Arweave

Arweave is misunderstood among Bitcoin Maxis: You're missing out on it's potential.

[SP]

Nov 25, 2024