• Stars
    star
    262
  • Rank 156,136 (Top 4 %)
  • Language
    PHP
  • Created over 12 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

📦 Yet another simple RSS writer library for PHP 5.4 or later. This library can also be used to publish Podcasts.

\Suin\RSSWriter

\Suin\RSSWriter is yet another simple RSS writer library for PHP 5.4 or later. This component is Licensed under MIT license.

This library can also be used to publish Podcasts.

Latest Stable Version Total Downloads Daily Downloads License Build Status Codacy Badge

Quick demo

$feed = new Feed();

$channel = new Channel();
$channel
    ->title('Channel Title')
    ->description('Channel Description')
    ->url('http://blog.example.com')
    ->feedUrl('http://blog.example.com/rss')
    ->language('en-US')
    ->copyright('Copyright 2012, Foo Bar')
    ->pubDate(strtotime('Tue, 21 Aug 2012 19:50:37 +0900'))
    ->lastBuildDate(strtotime('Tue, 21 Aug 2012 19:50:37 +0900'))
    ->ttl(60)
    ->pubsubhubbub('http://example.com/feed.xml', 'http://pubsubhubbub.appspot.com') // This is optional. Specify PubSubHubbub discovery if you want.
    ->appendTo($feed);

// Blog item
$item = new Item();
$item
    ->title('Blog Entry Title')
    ->description('<div>Blog body</div>')
    ->contentEncoded('<div>Blog body</div>')
    ->url('http://blog.example.com/2012/08/21/blog-entry/')
    ->author('John Smith')
    ->pubDate(strtotime('Tue, 21 Aug 2012 19:50:37 +0900'))
    ->guid('http://blog.example.com/2012/08/21/blog-entry/', true)
    ->preferCdata(true) // By this, title and description become CDATA wrapped HTML.
    ->appendTo($channel);

// Podcast item
$item = new Item();
$item
    ->title('Some Podcast Entry')
    ->description('<div>Podcast body</div>')
    ->url('http://podcast.example.com/2012/08/21/podcast-entry/')
    ->enclosure('http://podcast.example.com/2012/08/21/podcast.mp3', 4889, 'audio/mpeg')
    ->appendTo($channel);

echo $feed; // or echo $feed->render();

Output:

<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
  <channel>
    <title>Channel Title</title>
    <link>http://blog.example.com</link>
    <description>Channel Description</description>
    <language>en-US</language>
    <copyright>Copyright 2012, Foo Bar</copyright>
    <pubDate>Tue, 21 Aug 2012 10:50:37 +0000</pubDate>
    <lastBuildDate>Tue, 21 Aug 2012 10:50:37 +0000</lastBuildDate>
    <ttl>60</ttl>
    <atom:link rel="self" href="http://example.com/feed.xml" type="application/rss+xml"/>
    <atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/>
    <item>
      <title><![CDATA[Blog Entry Title]]></title>
      <link>http://blog.example.com/2012/08/21/blog-entry/</link>
      <description><![CDATA[<div>Blog body</div>]]></description>
      <content:encoded><![CDATA[<div>Blog body</div>]]></content:encoded>
      <guid>http://blog.example.com/2012/08/21/blog-entry/</guid>
      <pubDate>Tue, 21 Aug 2012 10:50:37 +0000</pubDate>
      <author>John Smith</author>
    </item>
    <item>
      <title>Some Podcast Entry</title>
      <link>http://podcast.example.com/2012/08/21/podcast-entry/</link>
      <description>&lt;div&gt;Podcast body&lt;/div&gt;</description>
      <enclosure url="http://podcast.example.com/2012/08/21/podcast.mp3" type="audio/mpeg" length="4889"/>
    </item>
  </channel>
</rss>

Installation

Easy installation

You can install directly via Composer:

$ composer require suin/php-rss-writer

Manual installation

Add the following code to your composer.json file:

{
	"require": {
		"suin/php-rss-writer": ">=1.0"
	}
}

...and run composer to install it:

$ composer install

Finally, include vendor/autoload.php in your product:

require_once 'vendor/autoload.php';

How to use

The examples directory contains usage examples for RSSWriter.

If you want to know APIs, please see FeedInterface, ChannelInterface and ItemInterface.

How to Test

$ vendor/bin/phpunit

Test through PHP 5.4 ~ PHP 7.0

$ docker-compose up

License

MIT license

More Repositories

1

iptables

⚙ 俺史上最強のiptablesをさらす
Shell
153
star
2

git-remind

Never forget to git commit and push
Go
94
star
3

kobito-cli

🛠 Kobitoをちょっぴり便利にするCLIツール: 記事のMarkdown/HTML/PDF出力、ファイル連携、stdinから新規記事作成、パスワードのリマインド…など
Go
64
star
4

php-ftp-client

📦 A simple PHP FTP client library working without FTP extension.
PHP
27
star
5

phpcs-psr4-sniff

[READ-ONLY] PHP_CodeSniffer sniff that checks class name matches PSR-4 project structure.
PHP
26
star
6

redux-multiple-reducers-example

💡 Redux Multiple Reducers Example
JavaScript
19
star
7

qiita-widget

🎁 Qiita Hackathonで作成したQiita API利用のブログパーツです。
JavaScript
18
star
8

chrome-extension-playground

👾 Chrome拡張を勉強するときや、スニペットを手軽に試すためのリポジトリです。
JavaScript
14
star
9

php-event-sourcing

PHP
13
star
10

php-cs-fixer-rules

[READ-ONLY] A Rule set for PHP-CS-Fixer mainly targeting PHP 7.1 or higher.
PHP
13
star
11

phpstorm-yaf-doc

📕 php-yaf API documentation for PhpStrom
PHP
12
star
12

ishi

Ad hoc http repeater/reverse proxy CLI tool for development. Example usage: $ ishi 192.168.100.1. This makes your Docker containers reachable from other machines on your LAN
Go
12
star
13

php-json

📦 Just a simple wrapper of json_decode() and json_encode(), but provides better interfaces: exception-based error handling and object oriented APIs.
PHP
10
star
14

react-like-button-example

💡 30分間React入門「いいねボタン」作成チュートリアル
JavaScript
10
star
15

php-playground

🧪🧬🔬My experimental codes of PHP.
9
star
16

php-yaf-twig

📦 Twig extension for Yet Another Framework.
PHP
9
star
17

chat-nodejs

👾 Suin Chat は Node.js, Socket.io, CoffeeScript, jQueryを組み合わせて作られたウェブチャットアプリケーションです。Socket.ioを勉強するために作ったシンプルな実装例になっています。
JavaScript
9
star
18

esa-api

esa.io API のクライアントライブラリ。Node.js、TypeScript/JavaScript向け。
TypeScript
8
star
19

php-marshaller

📦 Type-safe data mapping between JSON and a PHP class object.
PHP
8
star
20

php-qiita

📦 QiitaAPIを扱うためのPHP向けライブラリ
PHP
8
star
21

nginx-proxy-docker-compose-example

This is an example to show how to use nginx-proxy in docker-compose.
Shell
7
star
22

nextjs-ant-design-typescript

Next.jsでAnt Designを使うデモです。
TypeScript
7
star
23

envar

🛠 Environment Variables Manager - Define environment variables in one place and make it easy to manage variables.
Go
6
star
24

awesome-typescript

A curated list of amazingly awesome TypeScript libraries, resources and shiny things.
6
star
25

raspi-felica

⚙ RaspberryPi + FelicaリーダでSuicaの履歴を読み込み、そのデータをJSON形式にしてウェブに投げる半部品です。
Python
6
star
26

php-dmm

📦 DMM.comの商品情報検索APIをたたくためのPHPライブラリ。
PHP
6
star
27

popclip-chatgpt-emoji-extension

Welcome to the Autocomplete Emoji PopClip Extension - an ideal tool for anyone looking to enhance their messages with relevant emojis! Powered by ChatGPT
JavaScript
6
star
28

git-forgot

🛠 A tool to help you avoid forgetting git push/commit.
Go
6
star
29

esa-openapi

esa.io APIをOpenAPIで記述したJSONファイルを提供します。開発者はこれとOpenAPI Generatorのクライアント生成と組み合わせることで、C#, C++, Go, Rust, Java, Kotlin, Scala, PHP, Ruby, Python, Objective-C, Swift, Typescript, JavaScript, Dart, Elm, Haskellなど様々な言語でesa APIを呼び出せるようになります。
TypeScript
6
star
30

dotfiles-old

Shell
6
star
31

iterm2-cli

🛠 Control iTerm2 from cli. iterm2 is a command line tool to control iTerm2. You can change tab colors and titles with this command.
Go
6
star
32

php-image-resizer

📦 This is a simple image resizing library for PHP.
PHP
5
star
33

phpexcel-playground

👾 PHPExcelを勉強するときや、スニペットを手軽に試すためのリポジトリです。
PHP
5
star
34

devcontainer-starter

このリポジトリは、新規のプロジェクトや既存のプロジェクトにDev Containerを導入するためのスターターキットです。
Dockerfile
5
star
35

php-expose

📦 Makes non-public properties and methods be testable to help your unit tests with PHPUnit.
PHP
5
star
36

webpack-typescript-example

💡 An example of using Webpack for TypeScript developers
JavaScript
5
star
37

scala-playground

👾 Scalaを勉強するときや、スニペットを手軽に試すためのリポジトリです。
Scala
5
star
38

update-query

🛠 データベーススキーマ変更の失敗しにくい管理方法支援ツール
Python
5
star
39

google-cloud-functions-sendgrid-inbound-parse

This package is a backend for SendGrid Inbound Parse. It runs on Google Cloud Platform Functions. It receives the form data from SendGrid and publishes an EmailData event to GCP Pub/Sub.
TypeScript
5
star
40

cakephp-subcommand-injector

📦CakePHP Subcommand Injector make it possible that automatical adding Task classes as subcommands of a Shell class.
PHP
4
star
41

github-actions-playground

3
star
42

runspace

Isolated execution context for Node.js.
TypeScript
3
star
43

livexample

💯 Ensures your example codes works well by unit testing.
PHP
3
star
44

symplify-cs-fixer

[READ-ONLY] Make Symplify Coding Standard's fixers work with PHP-CS-Fixer.
PHP
3
star
45

php-skeleton

A template repository for kicking start PHP library development.
PHP
3
star
46

slack-times-feed

分報チャネルを見て回る手間を減らすためのSlackボットアプリケーションです。 各自の分報に発言があったとき、その発言を特定のフィードとなるチャネルにシェアします。
TypeScript
3
star
47

crystal-playground

👾 Crystal言語を勉強するときや、スニペットを手軽に試すためのリポジトリです。
Crystal
2
star
48

ifttt-webhook

PHP
2
star
49

linuxenv

suinの仮想Linux環境。ローカルの開発環境向け。
Shell
2
star
50

isObject.js

TypeScript friendly isObject function
TypeScript
2
star
51

email-data

A simple email data representation for TypeScript. This component provides a very simple reusable interface that represents an email. The interface was designed for the use case that treats received emails from POP3, SendGrid Inbound Parse, Gmail API and so on.
TypeScript
2
star
52

xoopsunit

PHP
2
star
53

meetup

An Example Implementation with Laravel + Clean Architecture + Domain-Driven Design
2
star
54

postgres-demo-transaction-across-two-schemas

👨🏻‍🔬 A repository to demonstrate that transactions across multiple schemas are available
Shell
2
star
55

XML

XML library for PHP
2
star
56

dockerfiles

🐳 Dockerfiles repository
Dockerfile
2
star
57

php-functions

便利な関数のまとめ
PHP
2
star
58

php-scala-migration-example

💡An example project to describe migrating UI to Scala from PHP step by step
Scala
2
star
59

symfony2-csrf-firewall-bundle

📦 Cross site request forgery firewall bundle for Symfony2
2
star
60

google-cloud-typed-pubsub-function

Strongly typed Google Cloud Function interface of the Pub/Sub handler for TypeScript.
2
star
61

japanese-tax-system-php-library

📦 このライブラリは日本の所得税計算を始めとする税金計算を扱うためのPHPで書かれたオープンソースライブラリです
PHP
2
star
62

symfony2-interactive-shell-bundle

PHP
1
star
63

phpunit-bootstrap

A distribution for quick start unit testing on PHP.
Shell
1
star
64

git-playground

Shell
1
star
65

lunaunit

Simplify Your Test Code
PHP
1
star
66

qiitame

PHP
1
star
67

goevent

📦 Go library for event driven
1
star
68

esa-markdown-format

esa.ioのMarkdownを自動整形する関数です
TypeScript
1
star
69

tokyopen

tokyopen
PHP
1
star
70

nodejs-playground

🧪🧬🔬My research related to Node.js
TypeScript
1
star
71

astah-anycode-php-template

1
star
72

esa-exporter

esa.io API から全データをエクスポートするライブラリ。
TypeScript
1
star
73

felica-keihiseisan

Ruby
1
star
74

homebrew-suin

Ruby
1
star
75

teikeibun-js

jQueryを使って定型文を生成するアプリ
JavaScript
1
star
76

codeiq-answer-viewer

🎁 CodeIQ出題者のための解答CSVを閲覧するWebアプリです。 Goで書かれています。
Go
1
star
77

toggl2slack

Go
1
star
78

php

Monorepo of Suin's PHP works.
PHP
1
star
79

phpmake

1
star
80

rails-playground

👾 Railsを勉強するときや、スニペットを手軽に試すためのリポジトリです。
Ruby
1
star
81

esa-hazukuroi

TypeScript
1
star
82

gatsby-source-esa

Gatsbyにesa.ioのデータを提供するソースプラグイン。esa API v1を使用してデータを取り込みます。
TypeScript
1
star
83

xoopsilex

An adaptor middleware between XOOPS Cube and Silex
1
star
84

gatsby-starter-netlify-cms

JavaScript
1
star
85

wallpapers

Mission Controlで複数のデスクトップを作ることができますが、このスクリプトは各デスクトップに壁紙を自動で設定してくれるものです。
Shell
1
star
86

typescript-playground

My TypeScript research, proof of concept and experimental code snippets.
TypeScript
1
star
87

jubatus-examples

💡🐆オンライン機械学習向け分散処理フレームワークJubatusのサンプルコードです。
Python
1
star
88

connpass-member-count-daily-tracking-with-google-spreadsheet

Connpassグループメンバー数を毎日Googleスプレッドシートに記録するツールです
TypeScript
1
star
89

ioreplacer

📦 Go library for replacing io. Read or write file replacing input/output
Go
1
star
90

gatsby-rehype-replace-urls

Gatsby rehype plugin that rewrites URLs of src/href attributes.
TypeScript
1
star