so i have this search http://www.ncbi.nlm.nih.gov/pubmed/?term=Streptococcus+dysgalactiae+subspecies+equisimilis and i want to get the rss feed(not manually), like a string with the xml, but i want to do it using php. ive tryed to search for a method on ncbi but i guess im not very good at it..
do i have to search in the html for the href? or something like this getting RSS feeds on website ?
The feed URL for the search isn't contained on the page. Clicking 'Create RSS' makes a call to the server to store the search terms and returns a feed with a new rss_guid. If there isn't an API to call you would need to examine the JavaScript and simulate a browser clicking on that button.
(As an implementation detail, the site returns different guids even when the search is the same, which implies that each 'Create RSS' is creating a new resource.)
Related
I am trying to convert the search results page of the following website into an RSS feed by using feed43.com or Google Apps Script:
https://www.zvg-portal.de/index.php?button=Termine%20suchen&land_abk=by
If I click on search (Suchen), I am forwarded to https://www.zvg-portal.de/index.php?button=Suchen but I can access this search result page neither with feed43.com nor with Google Apps Script. Is there a way to access all search results automatically?
you will have to send a POST request to that page. This basically means, that all the data you filled out in the search form is not transported to the search result page via the URL. therefore, if you copy the URL and paste it anywhere else, all information on what you were actually searching has been lost.
Check if the two tools you mentioned also support POST (instead of GET). if so, you can use chromes or firefox web developer tools (network tab) to show the values that were submitted to the search page and copy them there.
i want get complete content of a news or post of a website via feed. but we know that many websites only presents some part of news or post via their feed.
of course i know that exists a script called SimplePie that is developed for get content of websites via feed. but this script do not retrieve full content of a news.
of course i found a script called Full-Text Feeds that do It. but it is no free . i want a free script.
Do you know a similar script or way to do my need?
The code behind Five Filters' content extraction is actually open source, and is based on Readability's original Javascript (before they became a service).
You should be able to use it like this:
$page = file_get_contents($item_url);
$readability = new Readability($page);
if ($result = $readability->init()) {
$content = $readability->getContent()->innerHTML;
}
Not entirely sure what you're trying to do here but this might help you:
$full_page_content = file_get_contents('http://www.example.com/');
Edit: Ok, if I understand you correctly you'll need to do something like this:
Get rss feed
Use SimplePie or something like it to go through each feed item
For each item in RSS feed
Get the item's url
Get the content from that URL
Strip out the HTML/extract only the text you need
Combine all of these into a new RSS feed and send that to the user
Note: This isn't a simple thing to do. There is a reason that Full-Text RSS can charge for their product.
You could use http://magpierss.sourceforge.net/cookbook.shtml (free)
It retrieves RSS feeds. There are many many many PHP scripts that do that on the web... Google si your friend !! :)
I was wondering if someone knew a way of parsing the results of a query done through the search bar in Facebook. I don't manage to get around that "see more reults" button at the end, and I would like to find a way of getting all the results of the search.
I guess a DOM parser is not the solution, since it will only scan the results available on the page:
DOM to parse Facebook wall
Thank you in advance!
Guillermo
The problem is, all the results that show after "see more results" is clicked is loaded dynamically via AJAX. Your goal, then, will be to replicate that functionality by manually calling the URL that Facebook calls and getting the results from that (provided that Facebook doesn't use unique tokens to validate the loading of more results in the URL).
I would suggest that you see if you can find the URL that Facebook uses to load more search results.
I want to build an educational search engine on my web app and so I decided to crawl about 10 websites using PHP from my web page and store the data into my database for later searching. How do I retrieve this data and store them in my database?
You can grab them with file_get_contents() function. So you'd have
$homepage = file_get_contents('http://www.example.com/homepage');
This function returns the page into a string.
Hope this helps. Cheers
Building a crawler I would make the list of URLs to get and finally get them
A. Make the list
Define a list of URL to crawl
Add this URL to the list of URL to crawl (job list)
Define the max depth
Parse the first page, get all the find the href, get the link.
For each link: if it's from same domain or relative, add it to the job list.
Remove the current URL from the job list,
Restart from the next URL job list if non empty.
For this you could use this class, which makes parsing html really easy :
https://simplehtmldom.sourceforge.io/
B. Get content
Loop on the array made and get the content. file_get_contents will do this for you :
https://www.php.net/file-get-contents
This is just basically valid for a start, in step A, you should keep a list of already parsed URL to check them only one. Query string can also be something you look after to avoid scanning multiple pages with different query string.
I have a RSS feed generated by my server ( for example : http://www.seek-team.com/en/teams/counter-strike-source/feed/ )
and I want the feed (only the title of the feed + article + links of course ;)) to be displayed on other website (other domains) as a widget like facebook like box or similar (i took facebook for example because it's very easy to set-up (copy, paste, that's all).
For a similar problem, i used JSON-P , but it's too difficult for the user to understand the jquery function to decode and display JSON-P than using a simple javascript inclusion.
What would you recommand ? Where would you start ?
Do you have any "how-to" to achieve this project with only one contraint : it must be installed via a javascript to avoid complexity
Thanks.
Then your best bet is to put your feed in to feedburner, then use something like the buzzBoost widget. It lets you control number of entries, the title of the whole widget, display the date, the author part of the content, none of the content, open in new window or same window etc.
example javascript to embed...
<script src="http://feeds.feedburner.com/blah?format=sigpro" type="text/javascript" ></script><noscript><p>Subscribe to RSS headline updates from: <br/>Powered by FeedBurner</p> </noscript>
Magpie (http://magpierss.sourceforge.net/) is a simple RSS feed reader for PHP that works well. From there, you could build simple code to encapsulate it into the "widget" format you're looking for.