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
-------------sortingUa.php------------- | |
<?php | |
/** | |
* スマートフォンかどうかを振り分ける簡易的なクラスです。 | |
* | |
* @package sortingUa | |
* @author shobotch | |
* @sinse PHP 5.3.8 | |
* @version 1.0.0 | |
*/ |
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
<?php | |
//メソッド名とか変わってるかもしれないから一応確認してね。TLの取得もできるかもしれないけど、きまぐれで取得できてないからだれかデバッグしてくれるとありがたい | |
class ktaiWebLibrary{ | |
private $authenticity_token; | |
private $preliminaryCookie; | |
private $cookie; //_komadori_session=.+?;なものが入っています。 | |
private $login; //ログインに成功すればtrue 失敗していればfalseが入っています。 | |
public $userAgent = "Mozilla/0 (iPhone;)";//UserAgentを変更する場合はここを編集してください。 |
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
<?php | |
//基本的にどっか別のライブラリに組み込む形がいいと思うよ。 | |
//get_friends_timeline_multiメソッドの第一引数に配列でユーザーIDを入れると配列にそいつらのツイートが全部まとめて入ってくるから複数ユーザーをふぁぼったりするときに捗るかと。 | |
//checkSourceShootingStarにツイートのsourceを送るとShootingStarか判別してくれる。stsの経験値稼ぎに貢献できるね☆ | |
require 'twitteroauth.php'; | |
class twitteroauthS{ | |
// Consumer keyの値 | |
public $consumer_key = ""; | |
// Consumer secretの値 | |
public $consumer_secret = ""; |
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
<?php | |
$user[]= new ktaiWebLibrary("Twitter ID","Password"); | |
$user[]= new ktaiWebLibrary("Twitter ID2","Password"); | |
// and more... | |
$fav = 1; //ふぁぼをする場合1 | |
$rt = 0; //RTをする場合1 | |
/* | |
twitterのAPIで "http://api.twitter.com/1/statuses/user_timeline.json" | |
から引数で "trim_user"=>1 とした配列を$friends_timelineに渡してあげれば幸せになります。 |
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
<?php | |
/***************************************************************************** | |
このクラスは某、打ち止め氏のktaiwebから投稿するためのクラスを書きなおしたものです。 | |
cURLの方がアクセスは何故か早かったので、authenticity_tokenとCookieはcURLで取得しています。 | |
PHP.iniの設定でextension=php_curl.dllをコメントアウトしていると正しく使えず、errorが出る可能性があります。 | |
;を外して再起動すれば使えるようになると思います。 | |
-----テスト環境----- | |
・Windows Vista SP1 | |
・Apache/2.2.17 (Win32) |
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
/***************************************************************************** | |
このクラスは某、打ち止め氏のktaiwebから投稿するためのクラスを書きなおしたものです。 | |
cURLの方がアクセスは何故か早かったので、authenticity_tokenとCookieはcURLで取得しています。 | |
PHP.iniの設定でextension=php_curl.dllをコメントアウトしていると正しく使えず、errorが出る可能性があります。 | |
;を外して再起動すれば使えるようになると思います。 | |
-----テスト環境----- | |
・Windows Vista SP1 | |
・Apache/2.2.17 (Win32) | |
・PHP5.3.4 |
NewerOlder