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: Nostr, Bastyon, Session, RSS, Ethereum Push.

[SP]

Sep 19, 2024

Related Posts

How to Upload your Website to Arweave

How to Upload your Website to Arweave

Learn how to defy censorship using the Linux command line, to get your website on Arweave.

[SP]

Sep 19, 2024

HOT NEW Arweave RSS Feed!

HOT NEW Arweave RSS Feed!

Learn how our new RSS feed works on Arweave

[SP]

Aug 30, 2024

Arweave Gateway list

Arweave Gateway list

Get a full list of gateways

[SP]

Aug 30, 2024

How Arweave Offers Amazing Privacy

How Arweave Offers Amazing Privacy

Get a better understanding of how Arweave works in simple terms

[SP]

Aug 17, 2024