Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Oct 2005
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts

    file_get_contents, is it legal?

    if i use file_get_contents to get info from another website, and then process the info and display it in my own way, is it legal? is it gonna make ppl mad and cause problems, or is it acceptable?

    Code:
    <?php
    
    if ( !defined('IN_PHPBB') )
    {
    	die("Hacking attempt");
    	exit;
    }
    
    if($view!='simple')
    {
    	$template->set_filenames(array(
    		'xfire' => 'clan_xfire.tpl')
    	);
    }
    else
    {
    	$template->set_filenames(array(
    		'xfire' => 'clan_xfiresimple.tpl')
    	);
    
    }
    if($xfireshortname!='')
    {
    	foreach($xfireshortname as $value)
    	{
    		
    		$matches='';
    		$matches2='';
    		$array='';
    		$on='';
    		$noimage=$HTTP_GET_VARS['noimage'];
    		$onlineonly=$HTTP_GET_VARS['onlineonly'];
    		//get xfire
    		$log = file_get_contents('http://www.xfire.com/clans/' . $value . '/');
    		if($log!='')
    		{
    			preg_match_all('/(colData0=\')(.+?)(\' colData1=)/', $log, $matches);
    			preg_match_all('/(colData3=\')(.+?)(\' >)/', $log, $matches2);
    			preg_match_all('/(profile\/)(.+?[^\/])(">)/', $log, $matches3);
    			//$array = array_combine($matches[2], $matches2[2]);
    			//print_r($matches3[2]);
    			for($i=0;$i<count($matches[2]);$i++)
    			{
    				$array[]=array('NAME' => $matches['2'][$i], 'STATUS' => $matches2['2'][$i], 'PROFILE' => $matches3['2'][$i]);
    				//print_r($i);
    			}
    			//print_r($array);
    			if($array)
    			{
    				sort($array);
    				//	print_r($matches2[2]);
    				$template->assign_block_vars('xfiretable',array( 'NAME' => $value ));
    				foreach($array as $name => $value)
    				{
    					$name = '<a href="http://www.xfire.com/profile/' . $value['PROFILE'] . '/" title="View XFire Profile" target="_blank">' . $value['NAME'] . '</a>';
    					$img='<img src="images/xfireoffline.gif" title="Offline">';
    					if($value['STATUS']=='1')
    					{
    						$img='<img src="images/xfireonline.gif" title="Online">';
    						$name = '<a href="http://www.xfire.com/profile/' . $value['PROFILE'] . '/" title="View XFire Profile" target="_blank"><b>' . $value['NAME'] . '</b></a>';
    						$on=1;
    					}
    					if($noimage=='true') $img='';
    					if( ($onlineonly=='true' && $value['STATUS']=='1') || $onlineonly!='true')
    					{
    						$template->assign_block_vars('xfiretable.xfire',array( 
    								'USER' => $name,
    								'IMG' => $img
    							));
    					}
    				}
    			}
    			if($on!=1 && $onlineonly=='true')
    			{
    				$template->assign_block_vars('xfiretable.xfire',array( 
    						'USER' => 'No Members on Xfire'
    					));
    			}
    		}
    	}
    }
    
    
    ?>

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    If the website you are doing it to doesn't explicitly say you can reproduce the information, I wouldn't assume you can.

    Also accessing the targeted website and pulling the data for each page view on your site is rather uncool since it will take up their bandwidth and transfer as well. It probably wouldn't be appreciated for the same reason people dislike image hot-linking.

    I'd get permission to reproduce the information and implement some sort of caching system on your site so it will only go and retrieve the data from the site if it hasn't been updated in like 5 minutes, an hour, a day, the interval is dependent on how quickly the content changes but that'd reduce the impact your site would have on theirs.
    OracleGuy

  • #3
    Regular Coder
    Join Date
    Oct 2005
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts
    so i guess ill go pleading with them....

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,546
    Thanks
    8
    Thanked 1,093 Times in 1,084 Posts
    I would ask them about the information. I'm not sure what you're hot-linking,
    but do they offer an RSS feed for what you want? That might solve everything.

  • #5
    Regular Coder Karen S. Garvin's Avatar
    Join Date
    Nov 2006
    Location
    Maryland
    Posts
    227
    Thanks
    5
    Thanked 2 Times in 2 Posts

    Copyrights

    I agree. Just because it's on the web doesn't mean it's free or without copyright. It's always polite to ask and legally less risky.

    If I posted articles or photos and found them on another site without my permission, I would not be happy about it. Besides using my art for free, I would wonder if less traffic was visiting my site because they could find my stuff elsewhere.

    On the other hand, a link could be a worthwhile form of advertising.
    ----------------------------------------------
    Karen S. Garvin
    http://ksgarvin.wordpress.com


  •  

    Posting Permissions

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