Robin S Posted June 12, 2018 Posted June 12, 2018 On 6/11/2018 at 4:39 AM, combicart said: When a page is in the RSS feed and is already add to ProcessWire. Is there a way to find a page and update it's content through the API? You already have part of the logic for this - now you just need the else. I would tend to flip the logic around the other way though... if($p->id) { // $p is an existing page, so prepare it for saving new field values $p->of(false); } else { // No existing page so create one $p = new Page(); // ... } // Now set the field values of $p On 6/11/2018 at 4:39 AM, combicart said: When a page is not in the RSS feed anymore. Is there a way to delete all pages that are not in the RSS feed? Keep track of the job ids in the RSS feed using an array. Then find any pages with job ids that are not in the array and delete them. $job_ids = []; foreach($rss as $item) { $job_ids[] = $item->id; // The rest of your code... } // Implode for use in selector string $job_ids = implode('|', $job_ids); // Find pages for deletion $delete_pages = $pages->find("job_id!=$job_ids"); foreach($delete_pages as $delete_page) { $delete_page->delete(); } 1
combicart Posted June 22, 2018 Posted June 22, 2018 I would like to import a description field including it's HTML markup. In the RSS feed the markup is included, however by default the markup is stripped by the RSS feed module. Therefore i've used the option below to render the description including markup: $rss->stripTags = false; After adding this option, the values in the database are still escaped, e.g. like: <h3 class="deprecated-h3">Description</h3> <p>Description</p> Would it be possible to save the description field directly into the database (including it's HTML markup)?
a-ok Posted August 22, 2018 Posted August 22, 2018 Hi folks. Does this work over https? A few sites I was pulling the latest RSS feed from, since going to https, now no longer works. I've bar dumped it and it states: error protected => "Unable to load RSS feed at https://insidemodernism.co.uk/feed/: error protected => "Unable to load RSS feed at https://insidemodernism.co.uk/feed/: Any thoughts?
Robin S Posted August 22, 2018 Posted August 22, 2018 1 hour ago, oma said: error protected => "Unable to load RSS feed at https://insidemodernism.co.uk/feed/: I don't think that colon is supposed to be at the end - that URL leads to a 404. Looks the URL should be https://insidemodernism.co.uk/feed/
a-ok Posted August 22, 2018 Posted August 22, 2018 31 minutes ago, Robin S said: I don't think that colon is supposed to be at the end - that URL leads to a 404. Looks the URL should be https://insidemodernism.co.uk/feed/ Not sure why it's showing that. This is my code which was working before it forced https (I changed http to https in the load). $imRss = $modules->get('MarkupLoadRSS'); $imRss->limit = 1; $imRss->cache = 3600; $imRss->load("https://insidemodernism.co.uk/feed/"); bd($imRss);
Robin S Posted August 22, 2018 Posted August 22, 2018 Not sure if it's just the result of the forum but when I paste your code above into the Tracy console I can see some unwanted hidden characters. When I remove those it works fine: 1
a-ok Posted August 23, 2018 Posted August 23, 2018 Thanks, Robin. Must be the forum. See screenshot of what I entered into the console too to check and still get the same error. Weird ?
a-ok Posted August 23, 2018 Posted August 23, 2018 It works on my dev server and locally so could it be that something isn't enabled? Thing is if I try to get a feed from say The Guardian, it works. I'm stuck.
a-ok Posted August 26, 2018 Posted August 26, 2018 Is there any way I can find out more about the error?
a-ok Posted November 15, 2018 Posted November 15, 2018 Anyone? Still confused to why it's not working...
dragan Posted November 15, 2018 Posted November 15, 2018 I didn't install this module, but here's a little hint: Try to remove the @ character on this line: https://github.com/ryancramerdesign/MarkupLoadRSS/blob/master/MarkupLoadRSS.module#L371 @ before a function in PHP suppresses error messages. When you do that change, you have to refresh modules. Or delete and re-install it.
a-ok Posted November 16, 2018 Posted November 16, 2018 I attempted just to do a standard PHP fetch for the RSS to check if it had any errors... Warning: DOMDocument::load(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in /www3/453/www.modernshows.com/web/test.php on line 16 Warning: DOMDocument::load(): Failed to enable crypto in /www3/453/www.modernshows.com/web/test.php on line 16 Warning: DOMDocument::load(https://insidemodernism.co.uk/feed/): failed to open stream: operation failed in /www3/453/www.modernshows.com/web/test.php on line 16 I can obviously turn this off with the following (which isn't ideal) but unsure how to fix properly especially for this module. stream_context_set_default([ 'ssl' => [ 'verify_peer' => false, 'verify_peer_name' => false ] ]);
a-ok Posted April 10, 2020 Posted April 10, 2020 Sorry to bring this back up but I'm still having issues. I looked at the module at how it's grabbing the feed and tested it in a Tracy console and it returned false... $http = new WireHttp(); $xmlData = $http->get("https://insidemodernism.co.uk/feed/"); $rss = simplexml_load_string($xmlData); bdb($rss); Any further thoughts?
picarica Posted November 1, 2020 Posted November 1, 2020 hello, so i am trying to make a website that collects some urls collect rss feeds from them a output them in my website, and preferably somehow output the stuff inside my website too, i am not sure how do do it i never worked with RSS but i found this RSS feed loader module, but not sure how to input any feed into it. i am tryin to import for example this feed https://www.realwire.com/rss/?id=345&row=&view=Synopsis so far i am not sure how to feed it into the module and somehow input title from that feed and some more options? in module setinggs examples are only like fixed titles descriptions etc. how does this exacly work ?
teppo Posted November 1, 2020 Posted November 1, 2020 21 minutes ago, picarica said: hello, so i am trying to make a website that collects some urls collect rss feeds from them a output them in my website, and preferably somehow output the stuff inside my website too, i am not sure how do do it i never worked with RSS but i found this RSS feed loader module, but not sure how to input any feed into it. For the record I've merged your question to the Markup Load RSS support thread. The Modules/Plugins area of the support forum is dedicated to third party module support threads, one thread per module — please try to post your questions to the applicable thread if one exists. Thanks! 21 minutes ago, picarica said: i am tryin to import for example this feed https://www.realwire.com/rss/?id=345&row=&view=Synopsis so far i am not sure how to feed it into the module and somehow input title from that feed and some more options? Here's one of the examples from the first post in this thread: <?php $rss = $modules->get("MarkupLoadRSS"); $rss->limit = 5; $rss->cache = 0; $rss->maxLength = 255; $rss->dateFormat = 'm/d/Y H:i:s'; $rss->load("http://www.di.net/articles/rss/"); echo "<h2>{$rss->title}</h2>"; echo "<p>{$rss->description}</p>"; echo "<ul>"; foreach($rss as $item) { echo "<li>" . $item->title . "</li>"; } echo "</ul>"; It seems to me that this example is doing pretty much exactly what you asked, i.e. it loads a feed using this module and then outputs the title of the "channel" element from the feed, as well as a list of found items. Please let me know if I misunderstood your question, though.
picarica Posted November 1, 2020 Posted November 1, 2020 1 hour ago, teppo said: For the record I've merged your question to the Markup Load RSS support thread. The Modules/Plugins area of the support forum is dedicated to third party module support threads, one thread per module — please try to post your questions to the applicable thread if one exists. Thanks! Here's one of the examples from the first post in this thread: <?php $rss = $modules->get("MarkupLoadRSS"); $rss->limit = 5; $rss->cache = 0; $rss->maxLength = 255; $rss->dateFormat = 'm/d/Y H:i:s'; $rss->load("http://www.di.net/articles/rss/"); echo "<h2>{$rss->title}</h2>"; echo "<p>{$rss->description}</p>"; echo "<ul>"; foreach($rss as $item) { echo "<li>" . $item->title . "</li>"; } echo "</ul>"; It seems to me that this example is doing pretty much exactly what you asked, i.e. it loads a feed using this module and then outputs the title of the "channel" element from the feed, as well as a list of found items. Please let me know if I misunderstood your question, though. yes this looks promising i tired it but cannot seem to run it ? with your url it didnt worked, so i tried mine and so i got internal server error Quote 2020-11-01 16:46:12 guest http://localhost/blog/ Fatal Error: Uncaught Error: Call to undefined method stdClass::load() in /var/www/rss/site/templates/blog.php:20 Stack trace: #0 /var/www/rss/wire/core/TemplateFile.php(318): require() #1 /var/www/rss/wire/core/Wire.php(394): ProcessWire\TemplateFile->___render() #2 /var/www/rss/wire/core/WireHooks.php(823): ProcessWire\Wire->_callMethod('___render', Array) #3 /var/www/rss/wire/core/Wire.php(465): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array) #4 /var/www/rss/wire/modules/PageRender.module(536): ProcessWire\Wire->__call('render', Array) #5 /var/www/rss/wire/core/Wire.php(397): ProcessWire\PageRender->___renderPage(Object(ProcessWire\HookEvent)) #6 /var/www/rss/wire/core/WireHooks.php(823): ProcessWire\Wire->_callMethod('___renderPage', Array) #7 /var/www/rss/wire/core/Wire.php(465): ProcessWire\WireHooks->runHooks(Object(ProcessWire\PageRender), 'renderPage', Array) #8 /var/www/rss/wire/core/WireHooks.php(924): ProcessWire\Wire->__call('renderPage', Array) #9 /var/www/rss/wire/core/Wir (line 20 of /var/www/rss/site/templates/blog.php) i tried urls https://www.realwire.com/rss/feeds.asp and https://www.realwire.com/rss/?id=345&row=&view=Synopsis
picarica Posted November 1, 2020 Posted November 1, 2020 ok ok nevermind it works i just noticed i had wrong pluign, i had MarkupRSS instead of MarkupLoadRSS
picarica Posted November 1, 2020 Posted November 1, 2020 yes this works really good, but how do i input pultiple urls? and make them sort by date published? i already did some simple markup to make it look good, only problem is that $item->pubDate returns default date (01/01/1970 01:00:00 ) not sure why ? https://www.realwire.com/rss/?id=175&row=&view=Synopsis pub date is correct there yet on my site it is outputed wrongly
picarica Posted November 4, 2020 Posted November 4, 2020 QUESTION how does cache of this module work ? i wonder beacuse i will be using alot of RSS, and i would like to save them localy so that they would load and fetch and receck (for deleted articles) only once per day every night, i wonder how does the cache work ? does it deletes all the RSS everytime it times out ? or it rechecks existing and new RSS and only updates deleted ones and adds new ones, whats the logic behind it ?
chuckymendoza Posted January 29, 2021 Posted January 29, 2021 Hello friends, I have the following problem. I got an XML file that looks like this: <?xml version="1.0" encoding="UTF-8" ?> <EXAMPLE> <job> <jobTitle>A title</jobTitle> </job> <job> <jobTitle>A title</jobTitle> </job> </EXAMPLE> So, what is missing here is the usual opening <rss> tag right after <? xml and we don’t have the usual <channel> and <item> tags. Okay. So, MarkupLoadRSS can not read this file until I change the following line 221 in the MarkupLoadRSS.module from foreach($rss->channel->item as $item) { to this foreach($rss->EXAMPLE->job as $item) { to be in line with my .xml file and also add a opening and closing <rss> tag directly into the .xml file like this: <?xml version="1.0" encoding="UTF-8" ?> <rss version='2.0'> <EXAMPLE> <job> <jobTitle>A title</jobTitle> </job> <job> <jobTitle>A title</jobTitle> </job> </EXAMPLE> </rss> The problem is, later, I will not be able to change the XML file, it is generated by another site. So I need to tell MarkupLoadRSS to ignore the <rss> opening and closing tags. Does anybody know how this is possible? I had a deeper look into the module but I don’t see where the <rss> tag is a interpreted. Maybe someone can give me a clue, please? Thank so much in advance, Thomas
chuckymendoza Posted February 5, 2021 Posted February 5, 2021 Easy solution! If you want load an XML file like this one: <?xml version="1.0" encoding="UTF-8" ?> <EXAMPLE> <job> <jobTitle>A title 1</jobTitle> <company>Company 1</company> </job> <job> <jobTitle>A title</jobTitle> <company>Company 2</company> </job> </EXAMPLE> you can skip <Example> directly and change line 221 in MarkupLoadRSS.module to: foreach($rss->job as $item) { And in your template file to can access the <jobTitle> with: $rss = $modules->get("MarkupLoadRSS"); $rss->load("example.xml"); foreach($rss as $item) { echo $item->jobTitle; }
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now