crossle / hacker-news-mixin-bot Goto Github PK
View Code? Open in Web Editor NEWPost new hot stories from Hacker News to Mixin bot (Mixin ID: 7000100124)
License: MIT License
Post new hot stories from Hacker News to Mixin bot (Mixin ID: 7000100124)
License: MIT License
I built the souce code with my config/config.go
:
package config
const (
DatabasePath = "./news.db"
MixinClientId = "17ab3368-1d48-44b0-a11d-f3b91a1e140d"
MixinClientSecret = "3fd6c40e18569f2c16bfae3e01fb81dea1e5f66dff178fbe8bb44c74d61a6285"
MixinPin = "432834"
MixinSessionId = "36cd2c61-e35b-4dd8-97a7-6968c0cd913f"
MixinPinToken = "kbAlh7feq3a7inzpNZOWK0qZwZ+J/HG7ns6rwS1GuYwUJOK7WlUD1V7SVAAjgryyuEHZLsrFkcsoMn07jdc3oMU0NJMGSKbocPieHPOaQiCGAGrqhadLCgW94I15sBfQDhgaW6JN7GNX7ToruekdEVW2VC4cXASLJQ1YoyPjw5A="
MixinPrivateKey = `-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQCr94AAZtAK9i94vElPLMKGUzxhSxtGFt6nklKQsBGGY3ut/o/t
qRI+CEh7njRwSUa7PCO3Xlct2wv/TDT4Mn15JTCsQpj0ICcbvs3/PvSB5AzKMwi9
WQ4I/YXRukJunCADsDQ23MTOzQaG8fc9Yg5GN6gF0IeLPNnznKl314e6WwIDAQAB
AoGAWhoJxSwZYUTwRpBQ0N0g5wSBpHCXz7d33dD61biK1iEV0mqIuvtVBY+Nese/
rf2Ww8+U3yTdBLe6p38kWc8Kkiy8hsYhCnfw8fvmnbfxQSJWHHZfVuFLVvIsO4qf
MOK/xQflgptIZp589hxE1venAS0NUJSxRwwKucXRbuV5GIECQQDefYn/m/vABlCu
xi/oVY/wcIxSyD4RF0aCpS+XOquOFnugTfQhM1q+YI1iGXP8NAn/ai43IjNgXskk
q8fHo2ahAkEAxd3yIBlH7l1Yf4rY2N9hdMGw7/vtzwHtCdisWB8Zxnn1giPxKnNk
8jeK4ulJ2VXSrpz1qK4nUUM5BHRmi8yLewJAVJAofDOAGvsLfXIsUUT8AWn1m50q
IfrTvOIl1XfiLo4TDNm0GU5YhhVSh1+fOtNYnXBxAlmIZ29/SeXUd+d+IQJBAKmr
xqJry1jFRswnvgdKlgFOznEbsTLfzemxmSf/k1S05CfytizWwutJYZluvtrVU1JU
WfuJS0HNySjev8iFX90CQGYS67uDcEfETJT2Lqz5I8nbRZ9IXflyrlnwFlbh0+mJ
6GcoPqMe2twppk4N8oZorwsPpCsbdp3mBNbTHUnsuGY=
-----END RSA PRIVATE KEY-----`
)
then run:
hxzdeMac-mini:~/workspace/golang/src/github.com/crossle/hacker-news-mixin-bot (master) $ ./hacker-news-mixin-bot -service blaze
2018/10/12 17:42:57 start blaze
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x444e18b]
goroutine 1 [running]:
github.com/crossle/hacker-news-mixin-bot/vendor/github.com/MixinNetwork/bot-api-go-client.SignAuthenticationToken(0x46b98ce, 0x24, 0x46b98f2, 0x24, 0x46c64c0, 0x384, 0x46a6c22, 0x3, 0x46a69d5, 0x1, ...)
/Users/hxz/workspace/golang/src/github.com/crossle/hacker-news-mixin-bot/vendor/github.com/MixinNetwork/bot-api-go-client/auth.go:28 +0x81b
github.com/crossle/hacker-news-mixin-bot/vendor/github.com/MixinNetwork/bot-api-go-client.connectMixinBlaze(0x46b98ce, 0x24, 0x46b98f2, 0x24, 0x46c64c0, 0x384, 0x4e00000, 0x0, 0x4a00d50)
/Users/hxz/workspace/golang/src/github.com/crossle/hacker-news-mixin-bot/vendor/github.com/MixinNetwork/bot-api-go-client/blaze.go:187 +0xc0
github.com/crossle/hacker-news-mixin-bot/vendor/github.com/MixinNetwork/bot-api-go-client.Loop(0x49b11e0, 0xc42005c940, 0x49ab260, 0x4a2ede0, 0x46b98ce, 0x24, 0x46b98f2, 0x24, 0x46c64c0, 0x384, ...)
/Users/hxz/workspace/golang/src/github.com/crossle/hacker-news-mixin-bot/vendor/github.com/MixinNetwork/bot-api-go-client/blaze.go:83 +0xba
main.StartBlaze(0xc420087540, 0x0, 0x0)
/Users/hxz/workspace/golang/src/github.com/crossle/hacker-news-mixin-bot/blaze.go:27 +0x1f8
main.main()
/Users/hxz/workspace/golang/src/github.com/crossle/hacker-news-mixin-bot/main.go:20 +0x183
hxzdeMac-mini:~/workspace/golang/src/github.com/crossle/hacker-news-mixin-bot (master) $ ./hacker-news-mixin-bot -service news
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x42b6d48]
goroutine 1 [running]:
encoding/json.(*Decoder).refill(0xc42028a000, 0x4670680, 0xc420018101)
/usr/local/go/src/encoding/json/stream.go:152 +0xe8
encoding/json.(*Decoder).readValue(0xc42028a000, 0x0, 0x0, 0x4013a68)
/usr/local/go/src/encoding/json/stream.go:128 +0x275
encoding/json.(*Decoder).Decode(0xc42028a000, 0x45acec0, 0xc4200dcc40, 0x0, 0x0)
/usr/local/go/src/encoding/json/stream.go:57 +0x78
github.com/crossle/hacker-news-mixin-bot/vendor/github.com/qube81/hackernews-api-go.GetStories(0x46a6e22, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/hxz/workspace/golang/src/github.com/crossle/hacker-news-mixin-bot/vendor/github.com/qube81/hackernews-api-go/api.go:67 +0x1e6
github.com/crossle/hacker-news-mixin-bot/services.getTopStoryId(0xc420251e28)
/Users/hxz/workspace/golang/src/github.com/crossle/hacker-news-mixin-bot/services/news.go:31 +0x36
github.com/crossle/hacker-news-mixin-bot/services.(*NewsService).Run(0x4a2ede0, 0x49b12a0, 0xc4201b25d0, 0x49b12a0, 0xc4201b25d0)
/Users/hxz/workspace/golang/src/github.com/crossle/hacker-news-mixin-bot/services/news.go:62 +0x34
github.com/crossle/hacker-news-mixin-bot/services.(*Hub).StartService(0xc4200dcc20, 0x7ffeefbffa79, 0x4, 0x0, 0x0)
/Users/hxz/workspace/golang/src/github.com/crossle/hacker-news-mixin-bot/services/hub.go:37 +0x170
main.main()
/Users/hxz/workspace/golang/src/github.com/crossle/hacker-news-mixin-bot/main.go:26 +0x114
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.