Skip to content

Elephant418/Feedify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Feedify

Feedify transforms any data to a feed in PHP.

Currently support RSS & SiteMap feed.

Code example

$writer = new \Feedify\Writer();

/* Add global description */
$writer->title = 'Title of my blog';
$writer->description = 'Description of my blog';
$writer->siteURL = 'http://example.com/url/to/my/blog';
$writer->feedURL = 'http://example.com/url/to/my/blog/feed';

/* Add items & formatters */
// Add data from your database
$writer->addItems($myData);
// The 'date' attribute could be used directly
$writer->addAttribute('date');
// The 'title' attribute corresponds to my 'name' attribute
$writer->addAttributeMap('title', 'name');
// The 'url' attribute needs a specific formatter
$writer->addAttributeFormatter('url', function($article){
  return 'http://example.com/article/'.$article->id;
});

/* Output */
// As a RSS
$writer->output(\Feedify\Writer::RSS_FORMAT);
// Or as a SiteMap
$writer->output(\Feedify\Writer::SITEMAP_FORMAT);

Author & Community

Feedify is under MIT License.

It is created and maintained by Thomas ZILLIOX.

About

Transform any data to a feed in PHP

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages