SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard frank1's Avatar
    Join Date
    Oct 2005
    Posts
    1,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    curl and file get contents...queries

    well
    we are planning to have forex,weather in our sites....

    one way to use was use rss,some external includes...as there is no way we can hire a person to look around weather ,forex and enter data manually again and again...(pratically ...for small sites)

    another things that include may hamper the repuatation badly and sites may seems unprofessional...


    so we heard of curl and file get contents....function...

    some ?s
    is it safe to use...somewhere we read it brings security problems later
    which one to use curl or file get content..which one is better

    does these functions have future ..or it is much debated things and can be closed later?

    legally ...as forex and weather are quite universal data..there should not be huge (we mean "huge"..we know there is always some issues grabbing contents from other site) issues relating to it


    so any suggestion...

    by the way are there any such forex and weather service,scripts which retrives data internally...(doesnt not ad) and works with in our website...

    thanks

  2. #2
    SitePoint Wizard Hammer65's Avatar
    Join Date
    Nov 2004
    Location
    Lincoln Nebraska
    Posts
    1,161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There are no real security issues with just using Curl or file_get_contents(). How you use what you retrieve can cause a problem, but RSS is pretty safe.

    Curl can be made to act more like a standard web user agent. file_get_contents() is just a file system function that can, with the proper ini settings, work with URL's but you have no real control over how it does it in comparison.

    If you are retrieving a RSS feed, it may be is freely accessible. However, just because a TYPE of information is very common, does not mean it is free to access. If a company or individual has spent significant money and resources to compile the data, or paid to license it from somewhere else, they have every right to expect to charge for access to it. You are also using their network, which in one way or another cost them money.

    Follow the rules as much as possible. Find out if there is an API and if there are any access restrictions.

  3. #3
    SitePoint Wizard bronze trophy Kailash Badu's Avatar
    Join Date
    Nov 2005
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am sure there are freely accessible APIs from a few websites that will let you access the kind of information you are trying to fetch. Well defined APIs would provide a far better better and sturdy interface to the external data than than relying on hacked fixes like screen scraping with CURL or file_get_content. As for the security, either CURL or file_get_content could be hazardous if the external site contains malicious code and you do something unscrupulous with the fetched code.

  4. #4
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    As for the security, either CURL or file_get_content could be hazardous if the external site contains malicious code and you do something unscrupulous with the fetched code.
    Great point Kaikash.

    That's been true of everything I have downloaded and looked at so far.

    You need to be really careful.

    It's certainly given me a few ideas on how to protect my own sites from this kind of behaviour if I were to take offence about how the data is used.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •