Adding list items via the Backpack API
While my co-worker and I were discussing how nice it would be to have a document online that we could both work on simultaneously to track each other's progress, I suggested Backpack. I'd used it once before with someone else who used it regularly, but never really came back to it because I could never justify paying monthly for a service like that. I found that they had a free version, so I went ahead and created a site for us.
We had a pretty long list that we wanted to turn into to-do items, and it looked like the only way to get them in was to type them all out by hand. I appreciate how easy they made it to type out to-do items, but if you've already got the list, there's no sense in typing it all out.
After a quick look at the Backpack API, I threw this together, which worked as expected:
[code lang="bash"]sh backpack.sh < list[/code]
[code lang="bash"]
#!/bin/bash
LIST=`cat $1`
for i in ${LIST}
do
curl -H "Content-Type: application/xml" -d "YourAPITokenGoesHere $i " http://yoursite.backpackit.com/ws/page//lists//items/add
done
[/code]
The "list" file is just a text file with each item on a new line.