2013年11月25日月曜日

View HTTP Request and Response Header

View HTTP Request and Response Header


http://web-sniffer.net/


<?php
$url='http://t.co/gW5Y1PYqNM';
echo '<pre>';
print_r(get_headers($url));

echo '<br>';
print_r(get_headers($url,1));


?>


Array
(
    [0] => HTTP/1.0 301 Moved Permanently
    [1] => cache-control: private,max-age=300
    [2] => date: Mon, 25 Nov 2013 16:16:38 GMT
    [3] => expires: Thu, 01-Jan-1970 00:00:00 GMT
    [4] => location: http://www.dodofei.com/player.php?url=https://itunes.apple.com/fr/music-video/game-over-feat.-maitre-gims/id720776643?uo=2
    [5] => server: tfe
    [6] => set-cookie: muc=1;Domain=t.co;Expires=Sat, 07-Nov-2015 16:16:38 GMT
    [7] => Content-Length: 0
    [8] => HTTP/1.1 302 Found
    [9] => Date: Mon, 25 Nov 2013 16:15:47 GMT
    [10] => Server: Apache/2.2.22 (Win32) PHP/5.4.15
    [11] => X-Powered-By: PHP/5.4.15
    [12] => location: https://itunes.apple.com/fr/music-video/game-over-feat.-maitre-gims/id720776643?uo=2&at=10ldd8
    [13] => Content-Length: 119
    [14] => Connection: close
    [15] => Content-Type: text/html; charset=UTF-8
    [16] => Content-Language: ja
    [17] => HTTP/1.0 301 Moved Permanently
    [18] => Last-Modified: Mon, 25 Nov 2013 16:16:39 GMT
    [19] => Content-Type: text/html; charset=UTF-8
    [20] => x-apple-translated-wo-url: /WebObjects/MZStore.woa/wa/viewMusicVideo?uo=2&at=10ldd8&id=720776643&cc=fr
    [21] => x-apple-orig-url: https://itunes.apple.com/fr/music-video/game-over-feat.-maitre-gims/id720776643?uo=2&at=10ldd8
    [22] => x-apple-application-site: ST11
    [23] => apple-timing-app: 3 ms
    [24] => Location: https://itunes.apple.com/fr/music-video/game-over-feat.-maitre-gims/id720776643?ign-mpt=uo%3D2
    [25] => x-apple-lokamai-no-cache: true
    [26] => x-apple-application-instance: 2125714
    [27] => x-apple-aka-ttl: Generated Mon Nov 25 08:16:39 PST 2013, Expires Mon Nov 25 08:16:39 PST 2013, TTL 0s
    [28] => x-webobjects-loadaverage: 0
    [29] => x-apple-jingle-correlation-key: DA6WMX2UOPXMS
    [30] => Content-Length: 0
    [31] => Server: ATS/4.1.0
    [32] => Expires: Mon, 25 Nov 2013 16:16:39 GMT
    [33] => Cache-Control: max-age=0, no-cache
    [34] => Pragma: no-cache
    [35] => Date: Mon, 25 Nov 2013 16:16:39 GMT
    [36] => Connection: close
    [37] => Set-Cookie: ls=1; version="1"; max-age=10; expires=Mon, 25-Nov-2013 16:16:49 GMT; path=/; domain=.apple.com
    [38] => Set-Cookie: a=QQAJAAAACwAfUZAGMTBsZGQ4AAAAACr2LcM=; version="1"; expires=Sat, 30-Nov-2013 16:16:39 GMT; path=/; domain=.apple.com
    [39] => X-Apple-Partner: origin.0
    [40] => HTTP/1.0 200 OK
    [41] => Last-Modified: Mon, 25 Nov 2013 16:16:39 GMT
    [42] => x-apple-lok-response-date: Mon Nov 25 08:16:39 PST 2013
    [43] => x-apple-translated-wo-url: /WebObjects/MZStore.woa/wa/viewMusicVideo?ign-mpt=uo%3D2&id=720776643&cc=fr
    [44] => x-apple-orig-url: https://itunes.apple.com/fr/music-video/game-over-feat.-maitre-gims/id720776643?ign-mpt=uo%3D2
    [45] => x-apple-application-site: NWK
    [46] => apple-timing-app: 149 ms
    [47] => x-apple-aka-ttl: Generated Mon Nov 25 08:16:39 PST 2013, Expires Mon Nov 25 08:17:39 PST 2013, TTL 60s
    [48] => x-apple-application-instance: 1003405
    [49] => Content-Type: text/html; charset=UTF-8
    [50] => x-webobjects-loadaverage: 0
    [51] => x-apple-jingle-correlation-key: 3U2NYZPIBCE2S
    [52] => Server: ATS/4.1.0
    [53] => Cache-Control: no-transform, max-age=60
    [54] => Date: Mon, 25 Nov 2013 16:16:39 GMT
    [55] => Connection: close
    [56] => X-Apple-Partner: origin.0
)

Array
(
    [0] => HTTP/1.0 301 Moved Permanently
    [cache-control] => private,max-age=300
    [date] => Mon, 25 Nov 2013 16:16:39 GMT
    [expires] => Thu, 01-Jan-1970 00:00:00 GMT
    [location] => Array
        (
            [0] => http://www.dodofei.com/player.php?url=https://itunes.apple.com/fr/music-video/game-over-feat.-maitre-gims/id720776643?uo=2
            [1] => https://itunes.apple.com/fr/music-video/game-over-feat.-maitre-gims/id720776643?uo=2&at=10ldd8
        )

    [server] => tfe
    [set-cookie] => muc=1;Domain=t.co;Expires=Sat, 07-Nov-2015 16:16:39 GMT
    [Content-Length] => Array
        (
            [0] => 0
            [1] => 119
            [2] => 0
        )

    [1] => HTTP/1.1 302 Found
    [Date] => Array
        (
            [0] => Mon, 25 Nov 2013 16:15:48 GMT
            [1] => Mon, 25 Nov 2013 16:16:40 GMT
            [2] => Mon, 25 Nov 2013 16:16:40 GMT
        )

    [Server] => Array
        (
            [0] => Apache/2.2.22 (Win32) PHP/5.4.15
            [1] => ATS/4.1.0
            [2] => ATS/4.1.0
        )

    [X-Powered-By] => PHP/5.4.15
    [Connection] => Array
        (
            [0] => close
            [1] => close
            [2] => close
        )

    [Content-Type] => Array
        (
            [0] => text/html; charset=UTF-8
            [1] => text/html; charset=UTF-8
            [2] => text/html; charset=UTF-8
        )

    [Content-Language] => ja
    [2] => HTTP/1.0 301 Moved Permanently
    [Last-Modified] => Array
        (
            [0] => Mon, 25 Nov 2013 16:16:40 GMT
            [1] => Mon, 25 Nov 2013 16:16:39 GMT
        )

    [x-apple-translated-wo-url] => Array
        (
            [0] => /WebObjects/MZStore.woa/wa/viewMusicVideo?uo=2&at=10ldd8&id=720776643&cc=fr
            [1] => /WebObjects/MZStore.woa/wa/viewMusicVideo?ign-mpt=uo%3D2&id=720776643&cc=fr
        )

    [x-apple-orig-url] => Array
        (
            [0] => https://itunes.apple.com/fr/music-video/game-over-feat.-maitre-gims/id720776643?uo=2&at=10ldd8
            [1] => https://itunes.apple.com/fr/music-video/game-over-feat.-maitre-gims/id720776643?ign-mpt=uo%3D2
        )

    [x-apple-application-site] => Array
        (
            [0] => ST11
            [1] => NWK
        )

    [apple-timing-app] => Array
        (
            [0] => 3 ms
            [1] => 149 ms
        )

    [Location] => https://itunes.apple.com/fr/music-video/game-over-feat.-maitre-gims/id720776643?ign-mpt=uo%3D2
    [x-apple-lokamai-no-cache] => true
    [x-apple-application-instance] => Array
        (
            [0] => 2125634
            [1] => 1003405
        )

    [x-apple-aka-ttl] => Array
        (
            [0] => Generated Mon Nov 25 08:16:40 PST 2013, Expires Mon Nov 25 08:16:40 PST 2013, TTL 0s
            [1] => Generated Mon Nov 25 08:16:39 PST 2013, Expires Mon Nov 25 08:17:39 PST 2013, TTL 60s
        )

    [x-webobjects-loadaverage] => Array
        (
            [0] => 0
            [1] => 0
        )

    [x-apple-jingle-correlation-key] => Array
        (
            [0] => 736QQ6BZ67AXU
            [1] => 3U2NYZPIBCE2S
        )

    [Expires] => Mon, 25 Nov 2013 16:16:40 GMT
    [Cache-Control] => Array
        (
            [0] => max-age=0, no-cache
            [1] => no-transform, max-age=59
        )

    [Pragma] => no-cache
    [Set-Cookie] => Array
        (
            [0] => ls=1; version="1"; max-age=10; expires=Mon, 25-Nov-2013 16:16:50 GMT; path=/; domain=.apple.com
            [1] => a=QQAJAAAACwAfUZAGMTBsZGQ4AAAAACr2LcM=; version="1"; expires=Sat, 30-Nov-2013 16:16:40 GMT; path=/; domain=.apple.com
        )

    [X-Apple-Partner] => Array
        (
            [0] => origin.0
            [1] => origin.0
        )

    [3] => HTTP/1.0 200 OK
    [x-apple-lok-response-date] => Mon Nov 25 08:16:39 PST 2013
)

2013年11月24日日曜日

Amazon アソシエイト サイトリンク

Amazon アソシエイト サイトリンク


https://affiliate-program.amazon.com/gp/associates/network/main.html

https://affiliate.amazon.co.jp/gp/associates/network/reports/main.html

2013年11月19日火曜日

YouTube Data API 動画の取得と検索

YouTube Data API のカスタム パラメータ

https://developers.google.com/youtube/2.0/reference#Searching_for_videos



<?php
/*
https://developers.google.com/youtube/2.0/developers_guide_protocol_api_query_parameters#keysp
YouTube API
 */

?>
<?php

$g=$_GET['g'];


$x=new YoutubeAPI($g);

class YoutubeAPI{
public function YoutubeAPI($key){
$API_URL='http://gdata.youtube.com/feeds/api/videos?';
$para['client']='dodofei.com';
$para['format']='5';
$para['q']=$key;
$para['max-results']='5';
$para['key']='AI***********************************Uw';
$para['v']='2';

$paras=http_build_query($para);
$xmlurl= $API_URL.$paras;

$data=simplexml_load_file($xmlurl);
//echo '<pre>';
//print_r($data);
if($data->entry){
foreach ($data->entry as $key=>$val){
$l=explode(':', $val->id);
$ll[count($ll)]=$l['3'];
}
echo implode('|',$ll);
}else{
echo 'nodata';
}
}
}
?>

2013年11月6日水曜日

setInterval(tt,3000) タイマをして、Function を実行する練習

setInterval(tt,3000)  タイマをして、Function を実行する練習


<script type="text/javascript">

var x=0;
var time1=setInterval(tt,3000);
function tt(){
x=x+1;
alert(x);
}

</script>


タイマの停止
clearTimeout(timer1);

2013年11月4日月曜日

Twitterリミッ

Twitterリミッ
https://support.twitter.com/articles/249071-twitter-apidm


現在のTwitterリミット
現時点でのアカウント毎の技術的なリミットは以下の通りです。

ダイレクトメッセージ:250件/1日
ツイート:1,000件/1日。1日あたりのリミットは、更に細かい1時間に2回間隔のリミットに分かれます。リツイートも、ツイートとして数に考慮されます。
登録メールアドレスの変更:4回/1時間
フォロー(1日):1,000件/1日。これはあくまでも技術的なリミットであり、これ以外に過剰なフォローを禁止するルールがあります。フォローリミットについての詳細は、「フォローに関するルールと留意点」をご覧ください。
フォロー(アカウント毎):2,000件を超えるフォローは、アカウント毎の特定の比率に基づき制限されます。詳細は、「フォローに関するルールと留意点」をご覧ください。
これらのリミットは、ウェブ、モバイル、電話、API等を含む、すべてのデバイスからの操作を含みます。すべてのサードパーティのアプリケーションからのAPIリクエストは、1時間毎のAPIリミットとは別にトラックされます。アカウントを複数のサードパーティアプリケーションでご利用の場合は、APIリミットにかかりやすくなりますことご理解ください。詳細は「APIレートリミット」をご覧ください。

これらのリミットは、サイト利用が多い期間中に一時的に下げる場合があります。その場合は、Twitterステータスブログでご案内致します

iTunes Search API

iTunes  Search API

http://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html