<?php
$url = 'https://twitter.com/sessions';
$username="aa";
$password="aa";
$cookie="cookie.txt";
//twitter
$postdata = "session[username_or_email]=".$username."&session[password]=".$password."&commit=Sign In";
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt ($ch, CURLOPT_POST, 1);
$result = curl_exec ($ch);
curl_close($ch);
echo $result;
?>
'IT-Consultant' 카테고리의 다른 글
특정 디렉토리에 있는 파일중 7일 이전 파일 삭제하기 (0) | 2011.03.08 |
---|---|
이 탭은 복구되었습니다. 해결방법 (0) | 2011.02.11 |
WTP 환경에서 java 소스 수정 후 재시작하지 않고 적용된 내용 볼려면 (0) | 2011.01.10 |
jsp include 경로가 잘 안맞는경우 tomcat 5.5 이상이라면 아래 부분 확인 (0) | 2011.01.06 |
호주 라디오 방송 URL (0) | 2010.12.22 |