Hi there I just want to create a simple golang applications, which posts a new dent at identi.ca using
curl -u username:password http://example.com/api/statuses/update.xml -d status='Howdy!' -d lat='30.468' -d long='-94.743'
This is my code so far and imho this should work, but actually it isn't working, does anybody know how to fix this?
EDIT: Nope: I don't get any error messages :/
package main
import(
"fmt"
"os"
"bufio"
"exec"
)
func main() {
var err os.Error
var username string
print("Username: ")
_, err = fmt.Scanln(&username)
if err != nil {
fmt.Println("Error: ", err)
}
var password string
print("Password: ")
_, err = fmt.Scanln(&password)
if err != nil {
fmt.Println("Error: ", err)
}
var status string
print("Status: ")
in := bufio.NewReader(os.Stdin);
status, err = in.ReadString('
');
if err != nil {
fmt.Println("Error: ", err)
}
exec.Command("curl -u " + username + ":" + password + "https://identi.ca/api/statuses/update.xml -d status='" + status + "'" + "-d source='API'").Run()