Last active
September 7, 2016 03:21
-
-
Save leedohyung-dba/72e041a86bca05e5a0cb52d5727afbc0 to your computer and use it in GitHub Desktop.
[PHP][JavaScript]Twitter APIとFacebook APIのそれぞれ違う注意事項・制約事項 ref: http://qiita.com/leedohyung-dba/items/e8e3e39262c3b1caacc7
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
picture: PHPVALUE.upImage // = http://~ |
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
... | |
'curl_timeout' => 10, | |
... |
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
// twitterの場合はFacebookと違って、絶対経路(その以外は、エラーが発生されます)を求めています。 | |
// しかし、詳細画像の場合、コンテンツデザインなので、実際の画像が存在しません。(urlで接続するべき) | |
// そのため、ストリームをコピーして使っています。 | |
$tmp = tmpfile(); | |
stream_copy_to_stream(fopen($up_twitter_image, 'rb'), $tmp); | |
$streamGetMetaData = stream_get_meta_data($tmp); | |
$params = array( | |
'media[]' => '@' . $streamGetMetaData['uri'], | |
'status' => "{$up_twitter_content}" | |
); | |
$endpoint = $tmhOAuth->url('1.1/statuses/update_with_media'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment