This question about Not sure...: Answered
Edit Topic from Unix-Shell
Hi everybody, i am working with Twiki only for a few weeks so my experience level may be low. Its possible that the solution for my problem is very simple but i searched a view days an dont find any so i decided to try on this way.
I am trying to upload new contend to a topic without using a browser. Till now i copy the contend from a textfile open the topic with my browser, click the edit button an paste it. This is the course i am trying to automate. The contend is generated on my unix server so my favorite way would be to do it by a sh script but a plugin or other ways are welcome to. I am not asking for giving me a complete programm i am asking for a hint in which way i can do this. I am shure there are many people who create topics automated so i hope someone could give me a hint.
Thanks
--
StefanMaybaum
This is a bit similar to
Question317, where
DiabJerius was using
curl
to upload an attachment to a Foswiki topic from the command line. However, when Foswiki introduced validation this no longer worked, so he produced a script to do it. I haven't looked at his script, but you might be able to modify it to update a topic.
If you are still using TWiki, then I am not sure how their validation works, but it might be the same.
Alternatively, you can look at how
BuildContrib works, as that is used by developers to populate the Extensions topic from a local file.
--
AndrewJones - 16 Aug 2010
If you just want to integrate externally generated content, have a look at
IntegrateGeneratedContent.
--
MartinKaufmann - 16 Aug 2010
With root access I have used a simple approach a few times. Probably not well recommended but it works for me sometimes, this is only if you can handle bash/shell. Goto eg /var/www/foswiki/bin and run
perl -T save user=Main.JoeUser topic=Ourweb.NewTopic text="some text or not" formfield="the data"
You can drop formfield and text just to create an empty topic. Then just >> append text to the topic. If alot of new topics are to be generated you can name them
ourweb.TopicNameAUTOINC0
then you have serialized names (like
Foswiki:Sandbox/TestTopic1234). Otherwise see
CommandAndCGIScripts for other parameters.
--
LarsEik - 16 Aug 2010