Ejemplo n.º 1
0
 /**
  * Display the specified resource.
  *
  * @param  int $id
  * @return Response
  */
 public function show($id)
 {
     $rss = $this->rssService->find($id);
     $rssItems = $this->rssService->getRssItems($rss->url);
     dd($rssItems);
     return view('rss.show', compact('rss', 'rssItems'));
 }
Ejemplo n.º 2
0
 public function fetchRssFeeds()
 {
     $rssList = $this->rssService->getRssList();
     foreach ($rssList as $rss) {
         $this->rssNewsFeedsService->fetch($rss);
     }
     return true;
 }
 /**
  * @return \Illuminate\Http\RedirectResponse
  */
 public function fetch()
 {
     $rssList = $this->rssService->getRssList();
     foreach ($rssList as $rss) {
         $this->rssNewsFeeds->fetch($rss);
     }
     return redirect()->route('rssnewsfeeds.index')->with('success', 'Rss Feeds fetched successfully');
 }
Ejemplo n.º 4
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int $id
  *
  * @return Response
  */
 public function edit($id)
 {
     $post = $this->post->find($id);
     $news = null;
     if (request()->has('url')) {
         $news = $this->rss->fetchData(request('url'));
     }
     if (is_null($post)) {
         return redirect()->route('post.index')->with('error', 'Post not found.');
     }
     return view('post.edit', compact('post', 'news'));
 }