-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
749 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
bin | ||
pkg | ||
cmd/go-quitter/test | ||
cmd/go-quitter/go-quitter* | ||
cmd/go-quitter/go-quitter/bin/* | ||
cmd/example/example | ||
*~ | ||
*.log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# aerth [https://isupon.us] | ||
# https://github.com/aerth | ||
|
||
NAME=go-quitter | ||
VERSION=0.0.9 | ||
RELEASE:=v${VERSION}.$(shell git rev-parse --verify --short HEAD) | ||
PREFIX=/usr/local/bin | ||
all: | ||
@echo | ||
@echo "building go-quitter command line GNU Social client to" | ||
@echo " \"bin/${NAME}-${RELEASE}\"" | ||
@echo | ||
@mkdir -p bin | ||
@go build -v -o bin/${NAME}-${RELEASE} ./cmd/go-quitter | ||
|
||
deps: | ||
go get -d ./... | ||
|
||
|
||
install: | ||
sudo mv bin/${NAME}-${RELEASE} ${PREFIX}/${NAME} | ||
|
||
|
||
update: upgrade deps all install | ||
|
||
upgrade: | ||
git pull origin master | ||
|
||
cross: | ||
mkdir -p bin | ||
GOOS=windows GOARCH=386 go build -v -o bin/${NAME}-${RELEASE}-WIN32.exe | ||
GOOS=windows GOARCH=amd64 go build -v -o bin/${NAME}-${RELEASE}-WIN64.exe | ||
GOOS=darwin GOARCH=386 go build -v -o bin/${NAME}-${RELEASE}-OSX-x86 | ||
GOOS=darwin GOARCH=amd64 go build -v -o bin/${NAME}-${RELEASE}-OSX-amd64 | ||
GOOS=linux GOARCH=amd64 go build -v -o bin/${NAME}-${RELEASE}-linux-amd64 | ||
GOOS=linux GOARCH=386 go build -v -o bin/${NAME}-${RELEASE}-linux-x86 | ||
GOOS=freebsd GOARCH=amd64 go build -v -o bin/${NAME}-${RELEASE}-freebsd-amd64 | ||
GOOS=freebsd GOARCH=386 go build -v -o bin/${NAME}-${RELEASE}-freebsd-x86 | ||
GOOS=openbsd GOARCH=amd64 go build -v -o bin/${NAME}-${RELEASE}-openbsd-amd64 | ||
GOOS=openbsd GOARCH=386 go build -v -o bin/${NAME}-${RELEASE}-openbsd-x86 | ||
GOOS=netbsd GOARCH=amd64 go build -v -o bin/${NAME}-${RELEASE}-netbsd-amd64 | ||
GOOS=netbsd GOARCH=386 go build -v -o bin/${NAME}-${RELEASE}-netbsd-x86 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,65 @@ | ||
/* | ||
Copyright 2016 aerth | ||
This is a simple example program showing | ||
the usage of the quitter (GNU Social) library. | ||
You can import the libary as whatever name you want. | ||
Default is quitter, here it has an alias of qw. | ||
*/ | ||
package main | ||
|
||
import ( | ||
qw "github.com/aerth/go-quitter" | ||
"fmt" | ||
"os" | ||
"fmt" | ||
|
||
qw "github.com/aerth/go-quitter" | ||
) | ||
|
||
func main() { | ||
|
||
if len(os.Args) == 2 && os.Args[1] == "home" { | ||
q := qw.NewSocial() | ||
q.Username = "obviouslychangethis" | ||
q.Password = "nopassword?" | ||
q.Username = "username" | ||
q.Password = "nopassword" | ||
q.Node = "gnusocial.de" | ||
quips, err := q.GetHome(false) | ||
if err != nil { | ||
fmt.Println(err) | ||
} | ||
for i := range quips { | ||
if quips[i].User.Screenname == quips[i].User.Name { | ||
fmt.Printf("[@" + quips[i].User.Screenname + "] " + quips[i].Text + "\n\n") | ||
} else { | ||
fmt.Printf("@" + quips[i].User.Screenname + " [" + quips[i].User.Name + "] " + quips[i].Text + "\n\n") | ||
} | ||
} | ||
os.Exit(1) | ||
if err != nil { | ||
fmt.Println(err) | ||
} | ||
for i := range quips { | ||
if quips[i].User.Screenname == quips[i].User.Name { | ||
fmt.Printf("[@" + quips[i].User.Screenname + "] " + quips[i].Text + "\n\n") | ||
} else { | ||
fmt.Printf("@" + quips[i].User.Screenname + " [" + quips[i].User.Name + "] " + quips[i].Text + "\n\n") | ||
} | ||
} | ||
os.Exit(1) | ||
// Return: Could not authenticate you. | ||
} | ||
|
||
if len(os.Args) == 2 && os.Args[1] == "public" { | ||
q2 := qw.NewSocial() | ||
q2.Node = "gnusocial.de" | ||
quips, err := q2.GetPublic(true) | ||
if err != nil { | ||
fmt.Println(err) | ||
} | ||
for i := range quips { | ||
if quips[i].User.Screenname == quips[i].User.Name { | ||
fmt.Printf("[@" + quips[i].User.Screenname + "] " + quips[i].Text + "\n\n") | ||
} else { | ||
fmt.Printf("@" + quips[i].User.Screenname + " [" + quips[i].User.Name + "] " + quips[i].Text + "\n\n") | ||
} | ||
} | ||
os.Exit(1) | ||
|
||
|
||
}else { | ||
|
||
// Example usage | ||
fmt.Println(os.Args[0], "public") | ||
fmt.Println(os.Args[0], "home") | ||
} | ||
if err != nil { | ||
fmt.Println(err) | ||
} | ||
for i := range quips { | ||
if quips[i].User.Screenname == quips[i].User.Name { | ||
fmt.Printf("[@" + quips[i].User.Screenname + "] " + quips[i].Text + "\n\n") | ||
} else { | ||
fmt.Printf("@" + quips[i].User.Screenname + " [" + quips[i].User.Name + "] " + quips[i].Text + "\n\n") | ||
} | ||
} | ||
os.Exit(1) | ||
|
||
} else { | ||
|
||
// Example usage | ||
fmt.Println(os.Args[0], "public") | ||
fmt.Println(os.Args[0], "home") | ||
} | ||
} |
Oops, something went wrong.