Coder Social home page Coder Social logo

rss_feed's Introduction

php simple fetch RSS

Basic Usage

use MarekSiemaszko\classes\RSS;

// for parsing file/URL
$fileLocation = "http://feeds.nationalgeographic.com/ng/News/News_Main";
$rss = new RSS("file", $fileLocation);
print_r( $rss -> getItems() );

// for parsing plain text
$xml = '<?xml version="1.0" encoding="UTF-8"?>
            <rss xmlns:dc="http://someadress">
                <channel>
                        <item>
                            <title>some title</title>
                            <link>any link</link>
                            <description>text description</description>
                            <pubDate>Thu, 09 Aug 2018 17:40:00 GMT</pubDate>
                            <dc:creator>a nice guy</dc:creator>
                        </item>
                </channel>
            </rss>';

$rss = new RSS("plain", $xml);
print_r( $rss -> getItems() )

using the CLI

php src/console.php METHOD URL PATH

Parametrs:

  • METHOD
    • csv:simple - write data to specified file
    • csv:extended - append data to exists file
  • URL - RSS address
  • PATH - CSV filename

Full example:

php src/console.php csv:simple http://feeds.nationalgeographic.com/ng/News/News_Main eksport_prosty.csv

Testing

phpunit

rss_feed's People

Contributors

msiemaszko avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.