2019-09-04 12:33:32 +03:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
2019-09-10 11:21:39 +03:00
|
|
|
"fmt"
|
|
|
|
|
2019-09-04 12:33:32 +03:00
|
|
|
// "os"
|
|
|
|
// "strings"
|
|
|
|
|
|
|
|
// "errors"
|
|
|
|
|
|
|
|
// "encoding/json"
|
|
|
|
// "io/ioutil"
|
|
|
|
// "net/http"
|
|
|
|
|
|
|
|
// "net/url"
|
|
|
|
// "context"
|
|
|
|
// "html"
|
|
|
|
|
|
|
|
"github.com/gologme/log"
|
|
|
|
|
|
|
|
// "github.com/go-fed/activity/streams"
|
|
|
|
// "github.com/gorilla/mux"
|
|
|
|
// "gopkg.in/ini.v1"
|
|
|
|
// "github.com/davecgh/go-spew/spew"
|
|
|
|
|
|
|
|
"./activityserve"
|
|
|
|
)
|
|
|
|
|
|
|
|
var err error
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
|
|
|
|
// This is here for debugging purposes. I want to be able to easily spot in the terminal
|
|
|
|
// when a single execution starts
|
|
|
|
fmt.Println()
|
|
|
|
fmt.Println("======================= PHeRePHoNe ==========================")
|
|
|
|
|
|
|
|
// introduce ourselves
|
|
|
|
fmt.Println()
|
|
|
|
fmt.Println("Pherephone follows some accounts and boosts")
|
|
|
|
fmt.Println("whatever they post to our followers. See config.ini ")
|
|
|
|
fmt.Println("for more information and how to set up. ")
|
|
|
|
|
|
|
|
debugFlag := flag.Bool("debug", false, "set to true to get debugging information in the console")
|
|
|
|
flag.Parse()
|
|
|
|
|
|
|
|
if *debugFlag == true {
|
|
|
|
log.EnableLevel("info")
|
|
|
|
}
|
|
|
|
|
|
|
|
activityserve.Setup("config.ini", *debugFlag)
|
|
|
|
|
2019-09-10 11:21:39 +03:00
|
|
|
// actor, _ := activityserve.MakeActor("activityserve_test_actor_2", "This is an activityserve test actor", "Service")
|
2019-09-04 12:33:32 +03:00
|
|
|
// actor, _ := activityserve.LoadActor("activityserve_test_actor_2")
|
2019-09-10 11:21:39 +03:00
|
|
|
// actor.CreateNote("Hello World!")
|
|
|
|
|
|
|
|
activityserve.LoadActor("activityserve_test_actor_2")
|
2019-09-04 12:33:32 +03:00
|
|
|
|
|
|
|
activityserve.Serve()
|
2019-09-10 11:21:39 +03:00
|
|
|
}
|