Is there any way to import my RSS (news feed) from my wordpress site to my intel XDK application (App Framework 3) without any third-party sites?
連結已複製
You cannot import wordpress code into the XDK, since it is normally PHP server code. You certainly cannot use wordpress plugins in a Cordova app, they are not compatible. What you'll have to do is uncover the process used to collect, read and process your wordpress rss feed code and rewrite it into a format that works with a Cordova app.
The web services are great examples of how to interact with an external server. Please use them as an example of how it can be done. However, they do not provide the server component, only the client component. The web services code is interacting with existing public servers that are providing RESTful APIs.
Occasionally the providers will change their APIs, which can cause a specific web service to quit working, but that does not mean that ALL of them are no longer working. It is simply a collection of JavaScript libraries showing one way to access a variety of popular RESTful APIs. You can modify the code to meet your needs, use it as an example of one way to work with a server, it does not represent the only way to do this sort of thing.
the following script seems to show my RSS-news-feed but doesn't make any refresh/update when a new post is made. Is there any solution for this?
<script>
$(document).ready(function() {
var feed = "https://www.collatio.eu/test/feed/";
$.ajax(feed, {
accepts:{
xml:"application/rss+xml"
},
dataType:"xml",
success:function(data) {
output = '';
$(data).find("item").each(function () {
var el = $(this);
output += '<div class="rss-post">';
output += '<h2><a >'+el.find("title").text()+'</a></h2>';
output += '<div class="rss-post-content">'+el.find("description").text()+'</div>';
output += '<strong><a class="btn btn-primary" href="'+el.find("link").text()+'">Read Full Post</a></strong>';
output += '</div>';
});
$('#rss-feeds').html(output);
}
});
});
</script>
Unfortunately we don't have the resources to help with general coding issues. Try searching online on stack overflow. For instance, check out this stack overflow discussion >http://stackoverflow.com/questions/10943544/how-to-parse-an-rss-feed-using-javascript< or try searching: load rss feed javascript. Either of these will provide a good jumping off point to figure out what you need to about RSS Feeds. The stack overflow discussion does it a little differently but you can try this and see if it refreshes.
