動く setInterval(function(){mf_getymg();},10000);
動く setInterval(mf_getymg,10000);
動かない setInterval(mf_getymg(),10000);
動く setInterval('tt()',3000); クォーテーションで括る
function mf_getymg(){
var getmg=new XMLHttpRequest();
getmg.onreadystatechange=function(){
if (getmg.readyState==4 && getmg.status==200){
mf_test(eval(getmg.responseText));
}
}
getmg.open('GET','http://192.168.11.10/YahooAPI/List.php',true);
getmg.send(null);
}
function mf_test(mg){
var newli=document.createElement('li');
newli.innerHTML=mg;
var ul=document.getElementById('test');
ul.appendChild(newli);
}
クォーテーションで括る
<script type="text/javascript">
var x=0;
setInterval('tt()',3000);
function tt(){
x=x+1;
alert(x);
}
</script>
2013年10月6日日曜日
2013年10月5日土曜日
mb_strimwidth 文字化け
変更前
echo mb_strimwidth($temp->Result->Content.' (知恵袋)',0,280);
変更後
echo mb_strimwidth($temp->Result->Content.' (知恵袋)',0,280,',',UTF8);
echo mb_strimwidth($temp->Result->Content.' (知恵袋)',0,280);
変更後
echo mb_strimwidth($temp->Result->Content.' (知恵袋)',0,280,',',UTF8);
GET friendships/outgoing
<?php
include_once('../oauth/start.php');
/*
Friends & Followers
GET friendships/outgoing
https://dev.twitter.com/docs/api/1.1/get/friendships/outgoing
HTTP Methods GET
http://www.tryphp.net/2012/01/24/phpapptwitter-friendships_outgoing/
認証ユーザー(自分)がフォローリクエストを送信しているユーザーのうち、認証保留中になっているユーザーID一覧(整数値)を配列で返します。配列は構造化されたデータです。
*/
echo '<pre>';
$apiurl='https://api.twitter.com/1.1/friendships/outgoing.json';
$HTTP_Methods='GET';
$paras['cursor']='';
$paras['stringify_ids']='';
$x->twoauth($HTTP_Methods,$apiurl,$paras);
//$x->send_curl();
//var_dump($x->send_curl());
print_r($x->send_curl());
?>
例
include_once('../oauth/start.php');
/*
Friends & Followers
GET friendships/outgoing
https://dev.twitter.com/docs/api/1.1/get/friendships/outgoing
HTTP Methods GET
http://www.tryphp.net/2012/01/24/phpapptwitter-friendships_outgoing/
認証ユーザー(自分)がフォローリクエストを送信しているユーザーのうち、認証保留中になっているユーザーID一覧(整数値)を配列で返します。配列は構造化されたデータです。
*/
echo '<pre>';
$apiurl='https://api.twitter.com/1.1/friendships/outgoing.json';
$HTTP_Methods='GET';
$paras['cursor']='';
$paras['stringify_ids']='';
$x->twoauth($HTTP_Methods,$apiurl,$paras);
//$x->send_curl();
//var_dump($x->send_curl());
print_r($x->send_curl());
?>
例
Array
(
[0] => stdClass Object
(
[name] => 秋葉原観察者
[screen_name] => akibaviwer
[id] => 122061980
[id_str] => 122061980
[connections] => Array
(
[0] => following_requested
)
)
[1] => stdClass Object
(
[name] => ヤマダ電機
[screen_name] => yamada_official
[id] => 104421866
[id_str] => 104421866
[connections] => Array
(
[0] => following_requested
)
)
[2] => stdClass Object
(
[name] => UZ Plant〜サザンは日本の文化〜
[screen_name] => masyaglay
[id] => 234254127
[id_str] => 234254127
[connections] => Array
(
[0] => following_requested
)
)
[3] => stdClass Object
(
[name] => ##%;p;%##
[screen_name] => p15973736
[id] => 956344374
[id_str] => 956344374
[connections] => Array
(
[0] => following_requested
)
)
[4] => stdClass Object
(
[name] => stank
[screen_name] => herumosa123
[id] => 733950067
[id_str] => 733950067
[connections] => Array
(
[0] => following_requested
)
)
[5] => stdClass Object
(
[name] => 人生詰んでレラガールズ劇場
[screen_name] => ohpansy
[id] => 543740099
[id_str] => 543740099
[connections] => Array
(
[0] => following_requested
)
)
[6] => stdClass Object
(
[name] => ユキテーヌ
[screen_name] => yukitaine
[id] => 120747330
[id_str] => 120747330
[connections] => Array
(
[0] => none
)
)
)
2013年10月1日火曜日
GET friendships/lookup
<?php
include_once('../oauth/start.php');
/*
Friends & Followers
GET friendships/lookup
https://dev.twitter.com/docs/api/1.1/get/friendships/lookup
HTTP Methods GET
http://www.tryphp.net/2012/01/24/phpapptwitter-friendships_lookup/
*/
echo '<pre>';
$apiurl='https://api.twitter.com/1.1/friendships/lookup.json';
$HTTP_Methods='GET';
$paras['screen_name']='';
$paras['user_id']=rawurlencode('783214,6253282');
$x->twoauth($HTTP_Methods,$apiurl,$paras);
//$x->send_curl();
//var_dump($x->send_curl());
print_r($x->send_curl());
?>
例
include_once('../oauth/start.php');
/*
Friends & Followers
GET friendships/lookup
https://dev.twitter.com/docs/api/1.1/get/friendships/lookup
HTTP Methods GET
http://www.tryphp.net/2012/01/24/phpapptwitter-friendships_lookup/
*/
echo '<pre>';
$apiurl='https://api.twitter.com/1.1/friendships/lookup.json';
$HTTP_Methods='GET';
$paras['screen_name']='';
$paras['user_id']=rawurlencode('783214,6253282');
$x->twoauth($HTTP_Methods,$apiurl,$paras);
//$x->send_curl();
//var_dump($x->send_curl());
print_r($x->send_curl());
?>
例
Array
(
[0] => stdClass Object
(
[name] => Twitter
[screen_name] => twitter
[id] => 783214
[id_str] => 783214
[connections] => Array
(
[0] => none
)
)
[1] => stdClass Object
(
[name] => Twitter API
[screen_name] => twitterapi
[id] => 6253282
[id_str] => 6253282
[connections] => Array
(
[0] => none
)
)
)
配列を利用する;
$us=array('159536039,1185244459,1034053130,748788386,780785840,177437663,565343646,805594118');
$paras['user_id']=rawurlencode(implode(',',$us));
2013年9月29日日曜日
Twitter Errors
[errors] => sharing is not permissible for this status (Share validations failed)
stdClass Object
(
[errors] => Array
(
[0] => stdClass Object
(
[code] => 195
[message] => Missing or invalid url parameter.
)
)
)
stdClass Object
(
[errors] => Array
(
[0] => stdClass Object
(
[message] => Bad Authentication data
[code] => 215
)
)
)
stdClass Object
(
[errors] => Array
(
[0] => stdClass Object
(
[code] => 25
[message] => Query parameters are missing.
)
)
)
stdClass Object
(
[errors] => Array
(
[0] => stdClass Object
(
[code] => 158
[message] => You can't follow yourself
)
)
)
stdClass Object
(
[errors] => Array
(
[0] => stdClass Object
(
[message] => Sorry, that page does not exist
[code] => 34
)
)
)
stdClass Object
(
[errors] => Array
(
[0] => stdClass Object
(
[message] => Rate limit exceeded
[code] => 88
)
)
)
POST statuses/destroy/:id
<?php
include_once('../oauth/start.php');
/*
Twitter
POST statuses/destroy/:id
https://dev.twitter.com/docs/api/1.1/post/statuses/destroy/%3Aid
https://api.twitter.com/1.1/statuses/destroy/:id.json
HTTP Methods POST
*/
echo '<pre>';
$apiurl='https://api.twitter.com/1.1/statuses/destroy/382527698498621440.json';
$HTTP_Methods='POST';
$paras['id']='';
$paras['trim_user']='true';
$x->twoauth($HTTP_Methods,$apiurl,$paras);
//$x->send_curl();
//var_dump($x->send_curl());
print_r($x->send_curl());
?>
例
include_once('../oauth/start.php');
/*
POST statuses/destroy/:id
https://dev.twitter.com/docs/api/1.1/post/statuses/destroy/%3Aid
https://api.twitter.com/1.1/statuses/destroy/:id.json
HTTP Methods POST
*/
echo '<pre>';
$apiurl='https://api.twitter.com/1.1/statuses/destroy/382527698498621440.json';
$HTTP_Methods='POST';
$paras['id']='';
$paras['trim_user']='true';
$x->twoauth($HTTP_Methods,$apiurl,$paras);
//$x->send_curl();
//var_dump($x->send_curl());
print_r($x->send_curl());
?>
例
stdClass Object
(
[geo] =>
[entities] => stdClass Object
(
[urls] => Array
(
)
[hashtags] => Array
(
)
[user_mentions] => Array
(
)
)
[user] => stdClass Object
(
[id] => 371259452
[id_str] => 371259452
)
[in_reply_to_user_id] =>
[contributors] =>
[place] =>
[retweet_count] => 0
[source] => ツイッターの種
[in_reply_to_status_id_str] =>
[coordinates] =>
[retweeted] =>
[id] => 3.82527698499E+17
[in_reply_to_user_id_str] =>
[in_reply_to_status_id] =>
[truncated] =>
[in_reply_to_screen_name] =>
[created_at] => Tue Sep 24 15:31:25 +0000 2013
[id_str] => 382527698498621440
[text] => 福島県漁連 試験操業を再開へ
[favorited] =>
)
GET statuses/retweets/:id
$apiurl='https://api.twitter.com/1.1/statuses/retweets/373439054957670401.json';
$HTTP_Methods='GET';
$paras['id']=''; //id.json
$paras['count']='1';
$paras['trim_user']='true';
$x->twoauth($HTTP_Methods,$apiurl,$paras);
//$x->send_curl();
//var_dump($x->send_curl());
print_r($x->send_curl());
例
$HTTP_Methods='GET';
$paras['id']=''; //id.json
$paras['count']='1';
$paras['trim_user']='true';
$x->twoauth($HTTP_Methods,$apiurl,$paras);
//$x->send_curl();
//var_dump($x->send_curl());
print_r($x->send_curl());
例
Array
(
[0] => stdClass Object
(
[created_at] => Sun Sep 29 01:37:32 +0000 2013
[id] => 3.84129784651E+17
[id_str] => 384129784650801152
[text] => RT @masason: 被災地高校生の留学支援「TOMODACHIリーダーシップ・プログラム」に参加した100人が無事帰国。米国での学びと被災地の現状を9/1(日)13:30~アップルストア銀座にて報告します。ぜひ高校生の生の声を聞きに来て下さい。
[source] => Twitter for iPhone
[truncated] =>
[in_reply_to_status_id] =>
[in_reply_to_status_id_str] =>
[in_reply_to_user_id] =>
[in_reply_to_user_id_str] =>
[in_reply_to_screen_name] =>
[user] => stdClass Object
(
[id] => 118879992
[id_str] => 118879992
)
[geo] =>
[coordinates] =>
[place] =>
[contributors] =>
[retweeted_status] => stdClass Object
(
[created_at] => Fri Aug 30 13:36:23 +0000 2013
[id] => 3.73439054958E+17
[id_str] => 373439054957670401
[text] => 被災地高校生の留学支援「TOMODACHIリーダーシップ・プログラム」に参加した100人が無事帰国。米国での学びと被災地の現状を9/1(日)13:30~アップルストア銀座にて報告します。ぜひ高校生の生の声を聞きに来て下さい。
[source] => TwitRocker2 for iPad
[truncated] =>
[in_reply_to_status_id] =>
[in_reply_to_status_id_str] =>
[in_reply_to_user_id] =>
[in_reply_to_user_id_str] =>
[in_reply_to_screen_name] =>
[user] => stdClass Object
(
[id] => 99008565
[id_str] => 99008565
)
[geo] =>
[coordinates] =>
[place] =>
[contributors] =>
[retweet_count] => 247
[favorite_count] => 104
[entities] => stdClass Object
(
[hashtags] => Array
(
)
[symbols] => Array
(
)
[urls] => Array
(
)
[user_mentions] => Array
(
)
)
[favorited] =>
[retweeted] =>
[lang] => ja
)
[retweet_count] => 247
[favorite_count] => 0
[entities] => stdClass Object
(
[hashtags] => Array
(
)
[symbols] => Array
(
)
[urls] => Array
(
)
[user_mentions] => Array
(
[0] => stdClass Object
(
[screen_name] => masason
[name] => 孫正義
[id] => 99008565
[id_str] => 99008565
[indices] => Array
(
[0] => 3
[1] => 11
)
)
)
)
[favorited] =>
[retweeted] =>
[lang] => ja
)
)
登録:
コメント (Atom)