はじめに このサイトは、WordPressのカスタマイズが出来るようになるための参考サイトとして作成した。 もし興味を持った事があり、それに対して深い知識を得たいと思うならば、他サイトを参考にしてもらいたい。 WordPressのインストール方法 XAMPPでローカル環境構築して、簡単WordPressインストール 今回はこちらの場合で説明を行う。 USBメモリにWordPress用のローカル環境を3分で構築、お手軽過ぎるInstant WordPress すぐにWordPressを使いたい場合にオススメ。 WordPressをカスタマイズするために必要な知識 WordPressのカスタマイズでは、大きく分けて下記の6つを理解しなければならない。 ・WordPressテンプレートタグ http://wpdocs.sourceforge.jp/テンプレートタグ ・WordPress条件分岐タ
自前のRSSリーダーを作るため、 RSSをパースして、自分のサイトにRSS内の情報を表示するためのPHPライブラリ「MagpieRSS」の事を色々調べてみたので、その設定方法&サーバ設置方法を以下にまとめてみた。 ①magpierssから、magpierss-0.72.tar.gzをダウンロードして解凍。 (解凍できない場合はLhaplusをインストール) ②extlibフォルダとrss_cache.inc、rss_fetch.inc、rss_parse.inc、rss_utils.inc以外はすべて削除。 ③rss_fetch.inc内342行目の「define('MAGPIE_CACHE_AGE', 60*60)」を「define('MAGPIE_CACHE_AGE', 10)」に置換(無駄にキャッシュが働いてデータ取得できない状態を回避するため、1時間のキャッシュ保持期間を10秒に変
サイトの更新をした際に、RSSから記事の一覧を取得したい部分があったので、PHPであるRSS 2.0を取得し、その中からページのタイトルとURIを取り出してリスト表示(ul)するサンプルをメモしておく。 PHPでRSS 2.0からタイトルとURIを取得する RSSの取得 RSSはXML形式のデータなので、PHPで取得する場合は“simplexml_load_file”を使います。関数の引数に取得したいRSSのURIを指定します。 参考:PHP: simplexml_load_file – Manual RSSにおけるタイトルとURI 先ほどの関数で取得したRSSはオブジェクトに代入されています。RSS 2.0では、“channel->item->title”にページのタイトルが、“channel->item->link”にページのURIが格納されています。 したがって、channel->i
【スタイル】は東京都渋谷区でホームページ制作を行うウェブ制作会社です。ウェブサイト制作、SEO対策、ウェブマーケティングなどを承っています。良質テンプレートでの格安ホームページ制作プランもあります。
自分が運営するブログやよくアクセスするブログのRSSから新着記事の「タイトル」「URL」「概要」を取得する方法を説明します。 この方法を利用することで、サイトに新着記事を表示したり、自前のRSSリーダーを作成できます。 simplexml_load_file RSSから新着記事のタイトルなどを取得するには、simplexml_load_file関数を使うと超便利です。 simplexml_load_file('ここにRSSのURL', 'SimpleXMLElement', LIBXML_NOCDATA); この関数は、RSSのURLを引数に渡すと、RSSのXMLファイルをパースし、各種情報を持ったオブジェクトを返してくれます。 戻り値(オブジェクト) 実際にどんな戻り値なのか以下に掲載します(指定したRSSはWordPressサイト)。 [item]の要素は上([0])が概要で下([1]
İstanbul Doymak Bilmeyen Azgın Escort Kız Maral bakırköy escort • bakırköy escort Benim için de gerçekten hiç bitmeyen arzular ve tutkular var onların önüne geçemiyorum ve onları hayata geçirmek için de bütün çabayı gösteriyorum. Elbette İstanbul escort bayan randevularımda hedeflediğin bir şey daha var o da siz değerli beyefendilerin bana gösterdiği yoğun ilgiye layık olmak. Bunun için gerçekten
PHPで自動翻訳する方法の紹介 概要 Microsoft Translate APIを使用して、PHPで自動翻訳する方法を紹介します。 文字列を翻訳したい時って、結構ありますよね。 いや、そんなにないですかね?(汗) 私は多言語対応のCMSを作った時に、この自動翻訳処理を実装しました。 自分で翻訳機能が作れたらよいのですが、そうもいかないですよね。 こんな大量の翻訳データなど、一個人じゃそう簡単につくれるものではありません。 そういったときにこの Microsoft Translator APIを活用します。 Microsoft Translator APIを使うことでとても簡単に自動翻訳ができるのです。 Microsoft Translator API v2では、AJAX・HTTP・SOAPの3種類のサービスがあります。 今回はこの中の、HTTPとSOAPのサービスを用いた2パターンを紹
サイトを作成する際に、外部のサイトから情報を取得したい!という時に、phpだとfile_get_contentsを利用して取得すると言うのが、手段として思いつきますが・・・ 今回は、file_get_contentsではなく、curlを利用して外部のサイトから情報を取得してみたいと思います。 前置きはなしで、接続するための準備をしましょう。 まずは、接続を行うためのcurlオブジェクトを作成します。 [php] $conn = curl_init(); [/php] 次に接続に利用する内容を設定します。 SSLを利用する場合には、下記の2行を設定します。 [php] curl_setopt($conn, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($conn, CURLOPT_SSL_VERIFYHOST, true); [/php] ただし、証明
今まで、PHPからPOSTリクエストを送信する方法は、fsockopen関数を使って書く方法しか知らなかったが、調べてみると意外といろいろな方法があった。 fsockopen関数を使う方法 →参考:PHP TIPS Vol.3 ソケット拡張モジュールを使う方法 →参考:HTTPリスエストをそのまま返すPHPサーバ | Shin x blog ストリーム関数+ファイルシステム関数を使う方法 →参考:cURLを使わずに、PHPでPOSTリクエストを送信する - PHPプロ!ニュース HTTP拡張モジュールを使う方法 CURL関数を使う方法 →参考:php curlをつかったオリジナルクラス (myCurlRequest) - hiyuzawa.jpn.org Zend_Http_Clientを使う方法 →参考:【PHP TIPS】 51. ス
YAHOO! 知恵袋に(どなたか本当にお願いします!phpのcurlに関して教えて頂きたいです。)というPHPのcURLを使って、Googleにログインする方法が聞かれていたのでちょっと組んでみた。 実はこういうのは意外と面倒くさくて、 POSTデータでIDとパスワードを飛ばせばいいというものではない。 もちろんそれでログインできる(できてしまう)サイトもあるのだが、 セキュリティポリシーの高いサイトではそうはいかない。 不正なログインを防ぐためにフォーム内にトークンを埋め込み、 かつCookieにもそのトークンを埋め込んでおき、 サブミットされた際にフォームから飛んできたPOSTとCookieを比較しているのだ。 ちなみにGoogleとPixivはこの方式を採用している(2012/08/27現在)。 とりあえず早速ソースを見ていこう。 //URLを指定する $url='https://a
こんにちはこんにちは! エンジニア川端です。 ウェブサービスをブラウザに統合する「Fenrir Pass Connect」、みなさん、楽しんで頂けてますか? Fenrir Pass にログインすることで色々なウェブサービスを利用できる「Fenrir Pass Connect」。 今日は、その中でも実装が比較的面倒だった Google+ について、ログインするまでの流れをサンプルスクリプトでご紹介したいと思います。 Google+ APIェ…… Google+ にプログラムからアクセスして色々やりたい人のために「Google+ API」というものが用意されています……が! Note: The Google+ API currently provides read-only access to public data. All API calls require either an OAuth
今日はスクレイピング時に引っかがりがちな年齢認証などを回避してhtmlを取得する方法について(今日どハマりしたので 例えば、 取得したいページがリファラーで制限されている アダルト商品など年齢認証で目的のページにたどり着くのにクリックなどが必要 こんなケースに直面した場合の対処が必要になってくると思います。 年齢認証などは簡単な場合はURLに少し手を入れるだけで特に問題なく取得できるケースも多いですが、リファラーやcookieで制限されると少し手を加えないといけません。 Simple HTML DOM Parserで普通に取得する場合 普通はこんな感じでfile_get_htmlだと思います。 $html = file_get_html($item_url); // $item_urlは取得したいページのurl リファラーやcookieを設定して取得する場合 $opts = array(
WordPressの高速化について、WordPressプラグインを利用する方法から、MySQLチューニングなど、すぐに実践できそうな方法をまとめました。 WordPressカスタマイズ ●WP Super Cacheプラグインを使う WordPressのWP Super Cacheプラグインでキャッシュをします。色々試した中では一番効果的です。 参考サイト)ゆっくりと… » WordPressキャッシュ系プラグインの比較とサイトに適した選び方 ●不要なプラグインを削除する WP Super Cacheなどの高速化プラグインを導入するのと同じくらい効果的です。未使用プラグインがないか、またはプラグインを使用せずに、他の代替方法がないかを一度検討しましょう。 ●不要なウィジットを削除する ウィジットを利用していると、その分だけDBアクセスが発生するため、負荷になってしまいます。 サイド
2007.04.02 Monday ●指定文字列に挟まれた文字列を返す 例えば、 1位 「黄砂」 2位 「ソロモン諸島」 3位 「ハンゲーム」 (2007年4月2日 10時 ) という文字列があったとします。 この文字列から、「」に挟まれた文字列を取得する方法を考えてみます。 単に、文字列Aと文字列Bの間に挟まれた文字列Cを取得したければ、 preg_match を使うのが一番簡単ですが、初心者は正規表現の扱いに慣れていない方が多いでしょうから、strposとsubstrを組み合わせて作ってみます。 (正規表現を使った例もページの最後で紹介しておきます) -- -- 最初の分割ポイントとなる"「"については、explodeでセパレータとして指定すれば、そこから始まる文字列が配列に格納されます。 終了文字である"」"にういては、strposで探して、対象配列の最初から見つかった位置までを、s
PHPはapacheの権限で動くため、PHPによって作られたフォルダやファイルの所有者は、apacheユーザ(「www-data」「www」「nobody」など)になる。 そのフォルダやファイルのパーミッションが、他のユーザによる削除を許可していない場合、パーミッションか所有者を変更しない限り削除できないため、フォルダやファイルが削除できずに困ることがある。 そんなときには、パーミッションか所有者を変更すれば削除できる。 パーミッションを変更するならchmodコマンド、所有者を変更するならchownコマンドを使う。 > chown user_name file_name > chmod 777 file_name ただし、当然パーミッションを変更したり、所有者を変更できる権限が必要になる。 rootで実行できれば簡単だがroot権限で実行できない場合も多い。 そんなときは、ファイルを作っ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く