spacer
spacer search

SwissCenter

Search
spacer
Main Menu
Home
Documentation + FAQ
Screenshots
Downloads
Forums
Bug Tracking
History
Login
Username

Password

Remember me
?
No account yet?

Locations of visitors to this page

 
Home arrow Forums

SwissCenter Forums  


error: attempt access with invalid User Agent - 2009/07/25 07:37 Hi guys,

I trying to create a tailor made “Now Playing”-screen for a radio station called Rock Radio 1. All track info including AlbumArt is given here.

I tried to parse this page by
Code:

 $something file_get_contents('http://www.rockradio1.com/modules.php?name=Now_Playing&file=playing-lite');

If I echo $something, I get the following error message:
Code:

 You have attempted to access this site with an invalid User Agent.

Anyone any idea how to solve this and be able to parse the page?

many thanks, regards, Klaas

---------------------------------------------------------------------------
SwissCenter SVN 1283
Simese 1.46 / PHP 4.4.3 / MySQL 4.0.21 / Windows XP
Apache 2.2.11 / PHP 5.2.10 / MySQL 5.1.34 / Linux Synology 2.6.15
Synology DS107+ (128), firmware: DSM 2.2-0914
Pinnacle SC200 / PCH A-110
  | | The administrator has disabled public write access.
Re: error: attempt access with invalid User Agent - 2009/07/25 17:21 I think this is what you are after, it lets you fake the user agent:

http://php.mirror.facebook.net/manual/en/wrappers.http.php

The exampe from the page:
Code:

 <?php ini_set('user_agent'"PHP\r\nX-MyCustomHeader: Foo"); $fp fopen('http://www.example.com/index.php''r'); ?>

Player: ShowCenter 200 - Server: Fedora 13, SVN 1407
Contributions: Swedish translation
For Swedes...: SvD news parser (only interesting for Swedish users - q'n'd code)
  | | The administrator has disabled public write access.
Re: error: attempt access with invalid User Agent - 2009/07/26 09:07 Hi Margot,

Thanks for the reply, but I’m afraid I’m not sure how to continue. What should I do next to get the access to the source of http://www.rockradio1.com/modules.php?name=Now_Playing&file=playing-lite, so I can parse the info?

many thanks in advance, regards, Klaas

---------------------------------------------------------------------------
SwissCenter SVN 1283
Simese 1.46 / PHP 4.4.3 / MySQL 4.0.21 / Windows XP
Apache 2.2.11 / PHP 5.2.10 / MySQL 5.1.34 / Linux Synology 2.6.15
Synology DS107+ (128), firmware: DSM 2.2-0914
Pinnacle SC200 / PCH A-110
  | | The administrator has disabled public write access.
Re: error: attempt access with invalid User Agent - 2009/07/26 13:12 Hi Klaas,

for me this works from the ShowCenter:
Code:

  <?php     ini_set('user_agent','Mozilla/5.0;');      $something file_get_contents('http://www.rockradio1.com/modules.php?name=Now_Playing&file=playing-lite');     echo $something; ?>



While this doesn't work and gives the same error message you described in the first post:
Code:

   <?php     $somethingfile_get_contents('http://www.rockradio1.com/modules.php?name=Now_Playing&file=playing-lite');     echo $something; ?>

I hope that's what you are after.
Player: ShowCenter 200 - Server: Fedora 13, SVN 1407
Contributions: Swedish translation
For Swedes...: SvD news parser (only interesting for Swedish users - q'n'd code)
  | | The administrator has disabled public write access.
Re: error: attempt access with invalid User Agent - 2009/07/26 15:08 Hi Margot,

Yep, that did the trick ... many thanks, Klaas

---------------------------------------------------------------------------
SwissCenter SVN 1283
Simese 1.46 / PHP 4.4.3 / MySQL 4.0.21 / Windows XP
Apache 2.2.11 / PHP 5.2.10 / MySQL 5.1.34 / Linux Synology 2.6.15
Synology DS107+ (128), firmware: DSM 2.2-0914
Pinnacle SC200 / PCH A-110
  | | The administrator has disabled public write access.
spacer
 

Screenshots

www.flickr.com
This is a Flickr badge showing public photos from swisscenter. Make your own badge here.


 

Mambo is Free Software released under the GNU/GPL License.
spacer