thujohn / rss-l4 Goto Github PK
View Code? Open in Web Editor NEWRSS builder for Laravel 4
License: MIT License
RSS builder for Laravel 4
License: MIT License
It is not possible to add multiple category tags right now. I needed this feature and modified Rss.php
a little bit. What I did was changing line 112:
$elem_item->addCdataChild($options[0], $vI);
by this:
if (is_array($vI)) {
foreach ($vI as $v) {
$elem_item->addCdataChild($options[0], $v);
}
} else {
$elem_item->addCdataChild($options[0], $vI);
}
and added category|cdata
to every item
as an array. Does this make any sense?
Can you send simple for multiple channels? I dont know.
Hello,
I have little information about rss feeds.My feeds are in the link " http://feed.sirtcantalilar.com " By your package I was able to add them to my site. Now I am trying to add captions and attributions of images but still cant get them with the microsofts http://appproducer.bing.com/AppBuilder/FeedMapper.. Is it possible to make it ?
my route is
Route::get('/', function()
{
$feed = Rss::feed('2.0', 'UTF-8');
$feed->channel(array(
'title' => 'Sırtçantalılar blog yazıları',
'description' => 'Gezi rehberi. Yurtdışı ucuz tatil ve gezilecek yerler hakkında gezi rehberi tarzında hazırlanmış gezi yazıları içeren gezi ve seyahat sitesi.',
'link' => 'http://www.sirtcantalilar.com/'));
$posts = Post::with('thumbnail')->where('status', '=', 1)->get();
foreach ($posts as $post) {
$feed->item(array(
'title' => replace_tr($post->title),
'description|cdata' => (!empty($post->minicontent) ) ? $post->minicontent : (Str::words(strip_tags(replace_tr($post->content() )),50) ),
'guid' => $post->id,
'author' => replace_tr($post->author->name),
'media:content | cdata' => "http://www.sirtcantalilar.com/uploads/img/posts/thumbnails/".$post->id. "/thumb-" .$post->thumbnail->name,
'media:text' => $post->thumbnail->name,
'link' => 'http://www.sirtcantalilar.com/blog/'.$post->slug,
'pubdate' => $post->created_at,
'lastbuilddate' => $post->updated_at
));
}
$feed->save('uploads/blogs.xml');
return Response::make($feed, 200, array('Content-Type' => 'text/xml'));
});
Looks like this is pegged to 4.x and 5.x. I recognize it hasn't been updated in 6 years, but it still works well for our needs.
Do you know of a replacement that works with Laravel 6+, or plan to support Laravel 6, 7, 8?
Hello,
to use rss-l4 in Laravel 5, follow the installation steps explained in the Readme file ( https://github.com/thujohn/rss-l4/blob/master/README.md ), but skip the step that adds the service provider.
The service provider is incompatible with Laravel 5.
Therefore, open app/Providers/AppServiceProvider.php
. Find the register
method. Add these lines:
$this->app['rss'] = $this->app->share(function($app)
{
return new \Thujohn\Rss\Rss;
});
That's it.
Hi,
when I tried to validate the output in http://validator.w3.org/feed it says:
line 2, column 0: Unexpected encoding attribute on rss element
I think encoding needs to be put in line:
You tagged 1.0.2 before merging my autoloading improvements. Please could you tag another release to include that improvement?
Is there an example on how to include a enclosure in the xml?
doing
'enclosure' => 'url to image'
produces
//s3.amazonaws.com/test.s3.hotrodhotline.com/ui/5/02/5IdFF4SC1c.jpg
is there a way to add the url inside the enclosure tag like this
Hello,
if I try to add dc:creator as an item, the result is just "creator". There is a problem with namespace
in Rss.php, line 95, if I do :
if ($options[0] == "dc:creator") {
$elem_item->addChild($options[0], $vI, "http://purl.org/dc/elements/1.1/");
} else {
$elem_item->addChild($options[0], $vI);
}
it works
We need the possibility to define the namespace in item() function.
I tried to add a tag for itunes
itunes:explicitFalse/itunes:explicit
with this line:
$feed->channel(array('title' => $podcast->name, 'description' => $podcast->description, 'link' => Request::url(), "itunes:explicit" => 'False'));
But in the feed, it just shows up as
False
And the itunes podcast validator doesn't like it.
Any ideas for how to make that work? iTunes wants several tags like that to list the podcast.
Thanks!
Is there additional documentation that describes how to add additional fields, like media thumbnails for example? Or is that a feature not yet added into the package?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.