I have motion installed on my pi, and wondered if it was possible to write a python script to change the detection sensitivity to different values for day and night?

The value i'm interested in is called **threshold**
 in the **motion.conf** file.

Would I: 

A) edit the motion.conf file, save it and restart motion 

B) send the Motion mmaltest a command somehow, maybe passing parameters and getting past the authentication automatically

c) control motion start via cron which iv'e seen [here][1]

    0 9 * * * root /usr/bin/lwp-request http://localhost:8080/0/detection/start > /dev/null

so would this work for threshold threshold in the cron?

    0 9 * * * root /usr/bin/lwp-request http://localhost::8080/0/config/set?threshold 1000

***----------------------------------------------------------------------------edit below***

I try this 

 `http://localhost:8091/0/config/set?threshold=4000` from the command line and i get:

    Resolving localhost (localhost)... 127.0.0.1, ::1
    Connecting to localhost (localhost)|127.0.0.1|:8091... connected.
    HTTP request sent, awaiting response... 401 Authorization Required
    Authorization failed.

How can i include the username and password in the query string? 

  [1]: http://www.lavrsen.dk/foswiki/bin/view/Motion/RemoteControlHttp