Skip to content

Instantly share code, notes, and snippets.

@shobotch
shobotch / gist:1734142
Created February 4, 2012 00:55
ktaiweb投稿クラス【未完成】
/*****************************************************************************
このクラスは某、打ち止め氏のktaiwebから投稿するためのクラスを書きなおしたものです。
cURLの方がアクセスは何故か早かったので、authenticity_tokenとCookieはcURLで取得しています。
PHP.iniの設定でextension=php_curl.dllをコメントアウトしていると正しく使えず、errorが出る可能性があります。
;を外して再起動すれば使えるようになると思います。
-----テスト環境-----
・Windows Vista SP1
・Apache/2.2.17 (Win32)
・PHP5.3.4
@shobotch
shobotch / gist:1734939
Created February 4, 2012 03:25
ktaiweb投稿クラス【完成したけどデバッグまだ】
<?php
/*****************************************************************************
このクラスは某、打ち止め氏のktaiwebから投稿するためのクラスを書きなおしたものです。
cURLの方がアクセスは何故か早かったので、authenticity_tokenとCookieはcURLで取得しています。
PHP.iniの設定でextension=php_curl.dllをコメントアウトしていると正しく使えず、errorが出る可能性があります。
;を外して再起動すれば使えるようになると思います。
-----テスト環境-----
・Windows Vista SP1
・Apache/2.2.17 (Win32)
@shobotch
shobotch / gist:2757150
Created May 20, 2012 07:08
連続ふぁぼ(シングルコア)
<?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に渡してあげれば幸せになります。
@shobotch
shobotch / gist:2757158
Created May 20, 2012 07:13
twitterAPIから特定ユーザーのツイートを大量に取得する方法とかなんとか
<?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 = "";
@shobotch
shobotch / gist:2757162
Created May 20, 2012 07:16
Ktaiweb library var.2
<?php
//メソッド名とか変わってるかもしれないから一応確認してね。TLの取得もできるかもしれないけど、きまぐれで取得できてないからだれかデバッグしてくれるとありがたい
class ktaiWebLibrary{
private $authenticity_token;
private $preliminaryCookie;
private $cookie; //_komadori_session=.+?;なものが入っています。
private $login; //ログインに成功すればtrue 失敗していればfalseが入っています。
public $userAgent = "Mozilla/0 (iPhone;)";//UserAgentを変更する場合はここを編集してください。
@shobotch
shobotch / gist:2882296
Created June 6, 2012 14:40
スマホと振り分け
-------------sortingUa.php-------------
<?php
/**
* スマートフォンかどうかを振り分ける簡易的なクラスです。
*
* @package sortingUa
* @author shobotch
* @sinse PHP 5.3.8
* @version 1.0.0
*/
@shobotch
shobotch / gist:2980648
Created June 24, 2012 00:13
softcasのsrcらしきもの。噂のwinscard.dllのソースコード
// cl.exe /Ox /GA /LD winscard.cpp
// winscard.cpp Put the following files in the same folder:
// Crypto.cpp, Crypto.h, Decoder-ECM.cpp, Decoder.h, Global.h
// Keys.cpp, Keys.h, Keyset.cpp, Keyset.h
// You should modify "Size" in Decoder-ECM.cpp l42 to "Size-3"
#include <Windows.h>
#define htons htons_
#define ntohs ntohs_
#include "Crypto.cpp"
@shobotch
shobotch / function.get_page_info.php
Created August 18, 2012 07:08
WordPressにありがちなページナビをソース見ないでひとまずSmarty用に書いてみた(作りかけ)
<?php
/**
* Smarty {get_page_info} function plugin
*/
function smarty_function_get_page_info($param, &$smarty){
//var_dump($param["page"]);
//現在のページ数からどのくらいの範囲のページを詳細に表示するか
//例:5の場合、手前は現在のページからdetailの半分の値で小数点以下切り捨てで、この場合2こ表示する。
// 奥はdetailの数だけ表示するので、この場合4こ表示する。
@shobotch
shobotch / gist:4361982
Created December 23, 2012 04:33
4文字SNリスト
This file has been truncated, but you can view the full file.
最終更新日:
[12-23-01:28:08]
ae0c
ae0d
ae0e
ae0f
ae0g
ae0h
ae0i
<?php
class AccountSearch{
public $account_list = array();
public function checkAccount($name = array(), $single = false){
$url = array();
$falg = array();
foreach ($name as $value) {