Closed mu-hun closed 7 years ago
늦어서 죄송합니다.
calcium-tweet
is intended to use with crontab, and supports multiple accounts.
and please note, calcium-tweet
just updated on gist.
accounts:
screen_name: # your ID here
school: SCHOOL_CODE_HERE # required
feature: [...] # array of option string
# private: append @_ @screen_name in front of tweet
# gosam: add CSAT timer (...)
filter: 'regex string' # remove all regex match from tweet
timesIn: [12] # will only tweeted when executed at specified hour
key:
consumer_key: ~~~
consumer_secret: ~~~
access_token: ~~~
access_token_secret: ~~~
# (optional: more accounts here...)
Since calcium-tweet
doesn't provide login option, you should generate access token yourself. I personally use sferik/t to make tokens.
Can i generate token with apps.twitter.com ?
Yes but limited to application's owner. see 'Keys and Access Tokens' tab on your application page.
ed) Make sure your application have r/w permission before generate access token.
consumer_key
를 읽을 수 없다고 실행이 안됩니다,, 모듈 측에서 잘못된 건지 모르겠네요.
node_modules/twit/lib/twitter.js:46
consumer_key : config.consumer_key,
^
TypeError: Cannot read property 'consumer_key' of undefined
at new Twitter (/node_modules/twit/lib/twitter.js:46:33)
at Object.<anonymous> (index.js:36:11)
.calciumrc
{
"accounts": {
"school": "T100000124",
"key": {
"consumer_key": ,
"consumer_secret": ,
"access_token": ,
"access_token_secret":
}
}
}
twit 모듈이랑 같이 쓸 생각으로 config를 만들었기 때문에,
... = new T(config.key)
로 하시면 될 것 같습니다.
다시 확인해보니 config id 설정이 문제였습니다.
{
"accounts": {
"SeogwiMeal" : {
}
}
}
혹시 아래처럼 별다른 스케줄러 없이 forever
을 사용해야 되는건가요?
betafish@Z435 ~/Documents/github/heroku/seogobob master forever index.js start
warn: --minUptime not set. Defaulting to: 1000ms
warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
error: Forever detected script exited with code: 0
error: Script restart attempt #1
error: Forever detected script exited with code: 0
error: Script restart attempt #2
error: Forever detected script exited with code: 0
error: Script restart attempt #3
error: Forever detected script exited with code: 0
node에 별로 쓸만한 스케쥴러가 없어서, forever 등으로 실행하는 대신 crontab에 붙이게 만들었습니다.
# 분 시 일 월 요일
# m h dom mon dow command
00 00 * * 1-5 /home/hibiya/cron/calcium-tweet
10 12 * * 1-5 /home/hibiya/cron/calcium-tweet
40 17 * * 1-5 /home/hibiya/cron/calcium-tweet
Hello. I'm trying to make a twitter bot based on your module.
While i trying to make a twitter bot, I found a @SunrinMeal Twitter bot source code on your gist profile : https://gist.github.com/hibiyasleep/a29a1099147733d9d1e526d6671fa9c9
I modifie this source code and create the json file, but I did not get the OAuth to linking the twitter account.
Could you tell me the structure of
/home/hibiya/.calciumrc json
file?modified code
calciumrc.json
code