したらばTOP ■掲示板に戻る■ 全部 1-100 最新50 | |

botにこんな機能があったらいいなスレ

1pha:2009/12/17(木) 09:02:47
誰かのスクリプトで実装済みのものや、どこにも実装されてない思いつきでも、
なんでも思いついたら書いていってくださいー

81名無しさん:2011/05/16(月) 23:31:57
>>79
出来る

reply_pattern.phpに
"「レシピ:(.*)」"=> array(
"$1ですね。おぼえました。",
),

"料理作って"=> array(
"はいどうぞ、{cooked}です。",
),


function __constructでレシピ名を保存したファイルを配列に読み込んで、メンバー変数にセットしておく。


function makeReplyTweetsの
if(preg_match("@".$pattern."@u",$reply->text, $matches) === 1){の下あたりに
 マッチしたパターンが「レシピ:(.*)」だったら、
$matches[1]に格納されているレシピ名をレシピ名保存ファイルの末尾に追加。
 ※__constructでセットしたレシピ名配列に、$matches[1]が無いことを確認してから保存出来れば尚OK


function convertText内で
$text内の{cooked}を__constructでセットしたレシピ名配列からランダムで置換。

多分そんな感じ。

82うにゃ:2011/05/19(木) 01:49:57
①特定の人からのリプに別リプ送れるじゃない?

じゃぁ、
②特定の人のついーとに別リプったりとか?できるの?

例①:
・他人からリプで@bot おはよ
 botからリプで@anata おはようございます!
・俺からリプで@bot おはよ
 botからリプで@ore ……チッ

例②:
・貴方(@無しで)おはよ
 botからリプで@anata おはようございます!
・俺(@無しで)おはよ
 botからリプで@ore ……チッ…

分かりにくくてスマヌ。

83名無しさん:2011/05/19(木) 06:55:11
>>82
ほんとにわからないw
別リプとか他人、俺、貴方とか。
ごめんなさい、馬鹿で。
図解してw

84名無しさん:2011/05/20(金) 17:56:02
特定アカウントのタイムラインを取得→特定ワードがある場合に実行
簡単なことだ

85名無しさん:2011/06/08(水) 14:31:12
自動でプロフィール変更できたらいいなー、とよく思います
アイコン変更だけじゃなくて名前や位置情報も変えたい

86名無しさん:2011/06/08(水) 17:23:47
>>85
$eb->_setData('http://api.twitter.com/1/account/update_profile.xml',array('location'=>urlencode('東京都千代田区')));
とかすればいいんじゃないの?

Documentationに書いてあるよ。
http://dev.twitter.com/doc/post/account/update_profile

87名無しさん:2011/06/08(水) 18:24:41
>>86
やってみたけど文字化けして駄目だった

88名無しさん:2011/06/08(水) 20:22:47
>>87
変更はできたんだ。じゃ文字コードさえ間違ってなかったら、urlencode外せばいけるんじゃない?
いろいろ試してみて。

89名無しさん:2011/06/08(水) 21:36:34
>>88
あ、本当だ。外したら出来た
どうもありがとう!

90名無しさん:2011/06/20(月) 23:37:00
標準機能で、「占い」機能あるじゃないですか?
同一ユーザは1日1回しか占えないと言うように改造したいのですが、できますかね?
例えば、1日に既に1度リプライで結果を送信されたあと、再度「今日の占い」とbot宛に
ツイートすると、「占いは1日1回までですよ」みたいなのが、送信されるみたいな。

91名無しさん:2011/06/20(月) 23:43:19
90のものです。
書いた後に気づきましたがスレ違いですね。すみません。別場所に書きます。

92名無しさん:2011/07/06(水) 04:52:36
リプライ制限するときに、たとえば
「もうお話は終わりです」とか「もはやなにも言うまい…」
とか「いま忙しいからまたね」とか「あなたとの会話はひとまず終わりにしようね」とか、
決め台詞を言って、シメる機能があればいいなあ!!!と常々思っています!

93名無しさん:2011/07/08(金) 21:52:15
規制対策が欲しいです
規制されたらアイコン変更、規制直前に休憩制限・・・など

94名無しさん:2011/07/26(火) 07:52:07
twitterが日本語タグに対応したので、botがタグのほうの日本語に反応してしまって
ちょい困ってます
発言者さんがせっかくbotに話しかけても日本語タグつきで話されるとタグのほうの
単語に反応してしまいます。

今後、タグに反応しないスクリプトが必要になってくるような気がします。

95名無しさん:2011/07/26(火) 23:33:54
マルコフ機能付けたEasyBotter.php書いたけど需要あるかな

96名無しさん:2011/07/29(金) 04:26:18
>>95
よろしければ拝見したいです。

97名無しさん:2011/07/31(日) 21:56:27
>>96
遅くなりました
http://ow.ly/5RrPj
こんな感じです

98名無しさん:2011/08/01(月) 05:45:42
>>95
96です。ありがとうございます!
試させていただきますね!

99名無しさん:2011/08/05(金) 18:59:28
初心者スレにmentions,home_timeline重複取得に関して質問があったので、ちょっと書いておきます。

EB2はなぜか取得にscince_idパラメータを使用していません。重複削除には時間を使用しています。
(おそらくEB1で、ファイルを保存したりしないようにしようと考えたのでしょう。)

$limittime = $now - $minute * 70; //取りこぼしを防ぐために10秒多めにカウントしてる

しかもちょっと計算式違いますw $limittime = $now - ($minute * 60 + 10);でしょう
これに、GAE-cronのルーズさも加わって、おそらく正確には処理できていないと思われます。

$tweet_id = (string)$tweet->id;
if($limittime <= $time && $this->_latestReply < $tweet_id){ .....

「こいつバカじゃないの?↑の行で処理しているじゃん!」と思うかもしれませんが、
Snowflakeの導入でステータスIDは整数のintを超えていてfloat扱いになって以降、このへんかなり怪しいです。
詳しくは http://ideone.com/LWSm3 参照

$this->_latestReplyの内容はlog.datに書きこまれた、最後にリプライしたステータスIDですが、
リプライ処理、TL処理の両方で兼用しているので、トレースすればわかるのですが、どっちの最後の値かわかりません。
両方終えた大きな方です。
mentions、home_timelineに同じ$this->_latestReplyを使うと、どちらかで取りこぼしの”可能性”が出てきます。

なので、修正内容は、
1.リプライ、TLで最後にリプライしたステータスIDを別々に保存する。
2.保存したステータスIDをscince_idパラメータにして、mentions、home_timelineを取得する。
の修正が必要になります。

100名無しさん:2011/08/05(金) 19:01:36
>>99 の続き

以下に具体的な変更”案”を提示します。あくまで”案”です。
文法チェックと脳内トレースしかしていないので、過不足あるかもしれませんが、
おそらくこんな感じの修正になると思います。

-------------------------------------------------------------
コンストラクタ
$this->_repliedReplies = array();
$this->_logDataFile = "log.dat";
$this->_latestReply = file_get_contents($this->_logDataFile);
の下に
$this->_TLrepliedReplies = array();
$this->_TLlogDataFile = "TLlog.dat";
$this->_TLlatestReply = file_get_contents($this->_TLlogDataFile);
を追加
TLlog.datは予めlog.datをコピーして書き込み可で作成しておく。
-------------------------------------------------------------
同じくコンストラクタ
//どこまでリプライしたかを覚えておく
function saveLog(){
rsort($this->_repliedReplies);
return file_put_contents($this->_logDataFile,$this->_repliedReplies[0]);
}
の下に
function saveLogTL(){
rsort($this->_TLrepliedReplies);
return file_put_contents($this->_TLlogDataFile,$this->_TLrepliedReplies[0]);
}
-------------------------------------------------------------
reply関数内
$response = $this->getRecentTweets($response, $cron * $replyLoopLimit * 3);
$replies = $this->getRecentTweets($response, $cron);
の2行削除
since_idを使うのでgetRecentTweets関数は不要になる
-------------------------------------------------------------
reply関数内
$replies = $this->selectTweets($replies);

$replies = $this->selectTweets($respons);
に変更

101名無しさん:2011/08/05(金) 19:02:07
>>100 の続き
-------------------------------------------------------------
replyTimeline関数内
$timeline = $this->getRecentTweets($timeline, $cron);
を削除
since_idを使うのでgetRecentTweets関数は不要になる
-------------------------------------------------------------
replyTimeline関数内
$this->_repliedReplies[] = (string)$response->in_reply_to_status_id;

$this->_TLrepliedReplies[] = (string)$response->in_reply_to_status_id;
に変更
-------------------------------------------------------------
replyTimeline関数内
if(!empty($this->_repliedReplies)){
$this->saveLog();
}

if(!empty($this->_TLrepliedReplies)){
$this->saveLogTL();
}
に変更
--------------------------------------------------
removeRepliedTweets関数内
$id = (string)$reply->id;
if(in_array($id, $this->_repliedReplies) === FALSE){
$replies[] = $reply;
}
を、値がfloatだとin_arrayがまともに動作しないっぽいので
$replied_flg = false;
foreach($this->_repliedReplies as $k => $v){
if ($id === $v){
$replied_flg = true;
break;
}
}
foreach($this->_TLrepliedReplies as $k => $v){
if ($id === $v){
$replied_flg = true;
break;
}
}
if ($replied_flg == false){
$replies[] = $reply;
}
に変更

--------------------------------------------
function getFriendsTimeline(){
$url = "http://api.twitter.com/1/statuses/home_timeline.xml&quot;;
return $this->_getData($url);
}

function getFriendsTimeline(){
$url = "http://api.twitter.com/1/statuses/home_timeline.xml&quot;;
$url .= "?since_id=".$this->_TLlatestReply;
$url .= "&include_rts=false";
$url .= "&exclude_replies=true";
return $this->_getData($url);
}
に変更
--------------------------------------------
function getReplies($page = false)
{
$url = "http://api.twitter.com/1/statuses/mentions.xml&quot;;
if ($page) {
$url .= '?page=' . intval($page);
}
return $this->_getData($url);
}

function getReplies($page = false){
$url = "http://api.twitter.com/1/statuses/mentions.xml&quot;;
$url .= "?since_id=".$this->_latestReply;
$url .= "&include_rts=false";
if ($page) {
$url .= '&page=' . intval($page);
}
return $this->_getData($url);
}
に変更
--------------------------------------------

私はあまりEB詳しくないので、この修正が必要か否かの判断も含め、後のことはEBユーザーさんに丸投げしようと思います。

102名無しさん:2011/08/05(金) 19:06:06
>>99-101
一応スレチなんで
Botの改造方法を紹介するスレ
http://jbbs.livedoor.jp/bbs/read.cgi/internet/6629/1259840844/l100

103名無しさん:2011/08/16(火) 03:07:00
>>97さん
ありがとうございます!!!! マルコフ、待っておりました!!!!
感激です!!!!!
早速試させて頂きます!!! 本当に有難うございます!!!

104yuri:2011/08/28(日) 23:21:16
>>楽に稼げるアルバイトの件。情報載せておきます(#^^)b! http://tinyurl.k2i.me/GoeA

105バーバリー ハンドバッグ:2012/11/03(土) 02:35:27
はじめまして。突然のコメント。失礼しました。
バーバリー ハンドバッグ http://burberry.suppa.jp/

106名無しさん:2013/01/24(木) 01:25:50
スレチでしたら申し訳ありません。

絵文字のリプライにBOTが絵文字付きで返信できますか?

107kids uggs cheap:2013/09/25(水) 19:19:44
I always spent my half an hour to read this web site’s posts all the time along with a cup of coffee.
kids uggs cheap http://g-mex.com/kids-uggs-cheap.html

108waterproof uggs:2013/10/07(月) 00:52:25
It’s an amazing article in favor of all the web visitors; they will take advantage from it I am sure.
waterproof uggs http://daccalive.com/waterproof-uggs.html

109classic ugg:2013/10/08(火) 02:04:15
It’s awesome to pay a quick visit this web site and reading the views of all colleagues on the topic of this paragraph, while I am also keen of getting knowledge.
classic ugg http://itdpens.com/classic-ugg.html

110Cheap Ugg Boots:2013/10/20(日) 03:22:08
Hi to every , as I am genuinely keen of reading this weblog’s post to be updated on a regular basis. It includes pleasant stuff.
Cheap Ugg Boots http://natural-art.co.uk/

111Ugg Outlet:2013/10/21(月) 14:34:52
Hi to every one, for the reason that I am really eager of reading this weblog’s post to be updated on a regular basis. It includes nice data.
Ugg Outlet http://rsmotorhomesales.co.uk/

112ヴィヴィアンウエストウッド バッグ:2013/10/21(月) 17:04:45
Article writing is also a excitement, if you be familiar with afterward you can write if not it is difficult to write.
ヴィヴィアンウエストウッド バッグ http://www.livedojo.com/

113gucci バッグ アウトレット:2013/10/25(金) 16:57:35
And that once the several mysteries encompassing the previous Alimport chief commenced to sprout.
gucci バッグ アウトレット http://www.smokefreecharleston.org/templates/7-gucci-fashion.html

114アグ ブーツ:2013/10/30(水) 05:08:34
Therefore, increasingly, they kept clear connected with Ian, knowing that if these people dared to broach accidental injuries (particularly insoluble ones!) they would incur his / her wrath. It didn take Ian long to realise that the direct reports were failing to provide results and he became exceedingly frustrated within the lack of progress. Naturally he remonstrated at their side, explaining over and more than again the importance connected with proposing solutions. what you paid intended for to spot challenges and also produce SOLUTIONS! But it was to be able to no avail. The more Ian fretted, the more his direct reports took fright and suffered with solution paralysis. Eventually, Ian called a uncertainty meeting and demanded learn more. the problem? he shrieked, slamming his fist down about the table. But his direct information, flabbergasted to hear Ian when using the P word, couldn bring themselves to tell him that the issue was him! Advice to Ian.
アグ ブーツ http://www.shyaammusic.com/

115ヴィヴィアンウエストウッド バッグ:2013/10/31(木) 22:22:00
Wow, what a video it is! Actually pleasant quality video, the lesson given in this video is really informative.
ヴィヴィアンウエストウッド バッグ http://www.livedojo.com/

116コーチ バッグ 新作:2013/10/31(木) 23:52:18
These all YouTube gaming video lessons are actually in nice quality, I watched out all these along by means of my friends.
コーチ バッグ 新作 http://www.sedeinc.com/

117Moncler Polo:2013/11/03(日) 16:42:37
Hello to all, because I am in fact eager of reading this botにこんな機能があったらいいなスレ - Twitter Bot BBS web site post to be updated on a regular basis. It includes nice information.
Moncler Polo http://monclerparka.alt85.com

118Kate Spade sale:2013/11/04(月) 02:58:27
Hurrah, what a quality it is! For the reason that mostly YouTube movies have no nice quality, but this botにこんな機能があったらいいなスレ - Twitter Bot BBS is in fact a nice quality video.
Kate Spade sale http://katespadeonline.plastic-nameplates.com

119mikefrancois.com/icon/French/CanadaGooseHomme:2013/11/04(月) 14:06:25
These are genuinely impressive ideas in concerning blogging botにこんな機能があったらいいなスレ - Twitter Bot BBS . You have touched some nice factors here. Any way keep up wrinting.
mikefrancois.com/icon/French/CanadaGooseHomme http://www.mikefrancois.com/icon/French/CanadaGooseHomme.html


新着レスの表示


名前: E-mail(省略可)

※書き込む際の注意事項はこちら

※画像アップローダーはこちら

(画像を表示できるのは「画像リンクのサムネイル表示」がオンの掲示板に限ります)

掲示板管理者へ連絡 無料レンタル掲示板