こんにちは。開発担当の林です。 今回はタイトル通りPHP(5.2以上)で、とあるページの、はてブコメントと、ツイート、Facebook いいね!数を簡単に取得するためのテンプレ用ソースコードです。 最低限のコードですが、比較的よく使われるものなのかなと思ってまとめました。 何かのお役に立てれば幸いです。 ※ 本記事は、各サービスの公式 API を使っています。 はてなブックマークエントリー情報取得API Twitter API (日本語参考:Twitter API – TwitterまとめWiki ) Facebook Query Language (`・ω・´) はてブコメントと関連エントリーの取得 <?php // とあるページのアドレス(任意のアドレスをどうぞ) $sample_url = 'http://www.fenrir.co.jp/'; // はてブの情報取得 $hatena
TwitterやFacebookへのログイン機能をこれ1個で実装できるPHPライブラリ「HybridAuth」 2011年08月22日- HybridAuth, Open Source Social-Signle-Sign-On Solution for authentication through Facebook, Twitter, Google, Yahoo, MySpace, LinkedIn, AOL, Vimeo, FourSquare, OpenID and other Identity providers TwitterやFacebookへのログイン機能をこれ1個で実装できるPHPライブラリ「HybridAuth」 Facebook, Twitter, Google, Yahoo, Windows Live, MySpace, LinkedIn, FourSquare, O
PHP 80行で作るTwitterへRSSを投稿するbotの以下の改良版です。OAuth投稿対応bit.lyを使ったURLの短縮化それと、ちょっと、コードが短くなっただけです。OAuthの登録についてはオリジナルtwitter投稿ツールの作成のOAuthによる投稿までを参考にしてください。bit.lyのAPIについてはbit.lyのAPIを参考にしてください。 define('API_KEY_BIT_LY' , '**************************'); // bitlyのAPIキー define('API_LOGIN_BIT_LY' , '**************************'); // bitlyのログインアカウント名 define('CHECK_RSS_COUNT', 5); // 投稿するRSSのチェックする数 require("twitteroa
PHPで作ったゲームサイトでOAuthを利用したので、使い方やサンプルをメモしておきます。 このページ(SDN Project)を参考(というかそのまま)にしていますので、こちらも見てみてください。 OAuthも以前書いたOpenIDと同様に仕組みそのものは難しいのですが、サンプルを見ながら自分なりに変えていけば、それほど難しくなかったりします。 大まかな手順は、以下の通りです。 ①Twitterにアプリケーション登録をする ②OAuthのPHPをダウンロードする ③自分でPHPを書く ④サーバにアップ Twitterにアプリ登録 まず、Twitterに自分のアカウントでログインTwitterのOAuth申請のサイトから、自分のアプリケーション名やサイトのアドレスを登録します。 ・Application Nameは、自分のサービスの名前です。ユーザは認証する際にこのアプリケーション名を確認
来年も作りたい!ふきのとう料理を満喫した 2024年春の記録 春は自炊が楽しい季節 1年の中で最も自炊が楽しい季節は春だと思う。スーパーの棚にやわらかな色合いの野菜が並ぶと自然とこころが弾む。 中でもときめくのは山菜だ。早いと2月下旬ごろから並び始めるそれは、タラの芽、ふきのとうと続き、桜の頃にはうるい、ウド、こ…
yamaokaです。 TwitterのBasic認証によるユーザー認証が6月に廃止されるようですね。 認証はOAuthで行ってください、とのことなのですが OAuthの認証画面を表示するためにブラウザを起動するのがふさわしくないケースや、 そもそも貧弱なブラウザでうまく利用できないケースもあります。 そうした場合の解決方法として、xAuthという仕組みがTwitterに実装されています。 詳しくは次に紹介するweb上の記事を参照してください。 s-take Blog.: Twitterによる簡易版OAuth: "xAuth" OAuthでデスクトップアプリがブラウザを経由させたくないときのxAuth - Codin' In The Free World the.hackerConundrum: Sneak peek at Twitter's browserless OAuth creden
方法も何も、これさえできていれば PHPでTwitter APIのOAuthを使う方法まとめ – 頭ん中 一カ所書き換えるだけ。 事前の準備 アプリケーションを Sign in with Twitter に対応させときましょう。 https://twitter.com/apps に行く。 対象となるアプリケーションを選ぶ。(アプリケーション未登録の場合は上掲の記事に登録方法を書いているのでまずはそちらへ。) “Edit Application Settings” のボタンを押す。 一番下のあたりにある “Use Twitter for login” のところにチェックを入れて “Save” のボタンを押す。 はい完了。 Sign in with Twitter のやり方 OAuth でユーザーに承認してもらうとき、通常なら http://twitter.com/oauth/authoriz
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く