11
29
先日、コメント欄にてスイスの方からいくつか質問を頂いた件で、説明するより作っちゃえ的な対処をしてみました。
相変わらず、mb関数を使っているので1バイト圏の環境だと動かない可能性はあるんですが、とりあえずテストバージョンということでアップしてみました。
今回の修正は大きくわけて2点。
1.複数フィードの対応
URLをカンマ(,)で分けて指定することで対応します。
但し、複数フィード指定するとヘッダ部分でフィード用の埋め込み関数が使えません(permalinkとかフィードタイトル用のtitle,フィード画像のimageなど)
2.日付変数に引数を追加して、個別に書式を指定できるようにしました。
[+date(%Y/%m/%D)+]などのように括弧内に日付の書式を指定できるようにしました。
書式の中身はstrftimeと同じです、なお、従来通りに[+date+]と指定した場合には、スニペットのパラメタで指定したdate formatが利用されます。
テスト版ということで、スニペットの部分だけとなります。
また、simplepieは1.1.xおよび1.2の両方とも動きました。(あまり細かいところはチェックしていませんが)
ということで、テスト版はこちらからダウンロードしてください。
このエントリに定義されたタグ: piex


CMS

2009/12/14 00時49分55秒
Wow man, this is great, working like a charm!! Thank you very much!
The date-thing is working great, now I can do:
[+date(%H:%M)+] and [+date(%d.%m.%Y)+] in one template! Cool =)...
and also the multiple feeds feature works great...used it like this:
[[pieX? url=`http://www.bernerzeitung.ch/region/rss.html,http://www.bernerzeitung.ch/schweiz/rss.html,http://www.bernerzeitung.ch/ausland/rss.html` &tpl=`piex.scrollerTpl` &error=`piex.errorTpl` &max=10]]
when I understood you right...the native embed thing doesn't work...luckily I'm not using it like this...I just need the enclosure-link (I use it as a flashvar for an audio-player) so I changed $enclosure->native_embed($this->template_data["embed"]); to $enclosure->get_link(); ... that does exactly what I want it to do =)...just get the audio-link
I have also seen that there is one line less in the config part of the snippet:
now its:
$url = str_replace("|xq|", "?", $url);
$url = str_replace("|xe|", "=", $url);
in 0.8 it was
$url = str_replace("|xq|", "?", $url);
$url = str_replace("|xe|", "=", $url);
$url = str_replace("|xa|", "&", $url);
is there a reason for that?
Great work m8, keep it up!!
regards,
LuK
2009/12/15 01時26分28秒
Hello,Luk san.
> when I understood you right...the native embed thing doesn't work...luckily I'm not using it like this...I just need the enclosure-link (I use it as a flashvar for an audio-player) so I changed
What was any problem?
What do you write a sample embedded call seq. or sample source code?
>I have also seen that there is one line less in the config part of the snippet:
> :
> is there a reason for that?
This is my mistake.
I have to do it later and upload again, please fix it manually first.
Thank you,
2009/12/15 01時42分30秒
Wasn't really a problem because I don't use the native embed method of simplepie...I just read in your Post "However, the embedding function is not available for the specified feed", so I thought it wouldn't work...but I didn't try because I had to make the change I mentioned above also in the previous versions of pieX...the other thing I changed already =)...works still great!
2010/01/12 07時35分35秒
初めまして。
pieX0.9をつかわさせていただいております。有難う御座います!
当方でTwitterSearchAPIと連携させようとしたところ、2点ほどバグらしいのが見つかったので直してみました。
・・・と思ったら、1点上記で既に直されてますね(苦笑
あと一点ですが、URLミスや取得先のダウン時に発生するエラー処理で、配列ではないのにimplodeしてたので、以下のように直してみました。
line:about 332
$feedURLstr = implode(",",$feedURL);
to:
if (is_array($feedURL)) {
$feedURLstr = implode(",",$feedURL);
} else {
$feedURLstr = $feedURL;
}
#当方のサイトでも誘導しておきますー。
これからも何卒よろしくお願いいたします!
2010/01/12 22時43分29秒
あ,ありがとうございます。
いずれはマージしてアップし直します(^^;
いつになるかが微妙ですが(´-`)
ありがとうございました