{"size": 750, "ext": "js", "max_stars_repo_path": "src/App.js", "max_stars_repo_name": "enter-haken/cors_test", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/App.js", "max_issues_repo_name": "enter-haken/cors_test", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/App.js", "max_forks_repo_name": "enter-haken/cors_test", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.2702702703, "max_line_length": 65, "alphanum_fraction": 0.548}
import React, { Component } from 'react';
import './App.css';
import Parser from 'rss-parser';

class App extends Component {
  constructor(props) {
    super(props);

    this.state = {
      feed : { 
        title : null,
        items : [] 
      } 
    };
  }

  componentWillMount() {
    let parser  = new Parser();
    const CORS = "https://cors-anywhere.herokuapp.com/";
    const RSSFEED = "http://www.nwb-campus-blog.de/feed";
    parser.parseURL(CORS + RSSFEED, (err,feed) =>  {
       this.setState({feed: feed}); 
      });
  }

  render() {
    return (
      <div className="App">
        <h1>{this.state.feed.title}</h1>
        {this.state.feed.items.map(item => <p>{item.title}</p>) }
     </div>
    );
  }
}

export default App;
