Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Author Topic: Wrong language result when parsing external site  (Read 3910 times)

Jason Kingery

  • Sr. Member
  • ****
  • Karma: 1
  • Posts: 298
    • http://denial-design.com
Wrong language result when parsing external site
« on: October 18, 2006, 03:42:21 am »

Ok, I'm SO confused, I'm working on a site for a musician friend of mine. And I'm using a script to parse his myspace page and grab his gigs, just to make his life easier. but for some efffed up reason, It will only display in german...

Code: [Select]
$handle = fopen("http://www.myspace.com/niksorak", "rb");
$contents = '';
if ($handle) {
  while (!feof($handle)) {
    $contents .= fread($handle, 8192);
  }
}

fclose($handle);
$pieces = explode("", $contents);

$pieces2 = explode("
", $pieces[1]);

echo "
";
echo $pieces2[0];
?>HELP ME PLEASE, I want to throw the computer through a wall right now.. I know it's something super simple, I just can't figure out what!

If you want to see it live then...
http://denial-design.com/clients/nik/gigs.php

Rob

  • Full Member
  • ***
  • Karma: 1
  • Posts: 219
    • http://www.ruthinweather.co.uk
Wrong language result when parsing external site
« Reply #1 on: October 18, 2006, 08:40:20 am »

Absolutely bizarre problem you have there.

As Myspace is not even German cannot undestand how this has even happened.

Could it be a hosting or server problem converting it to German?   There is certainly no German in the Myspace source code.

I will dig a little more and see if any the guys I work with have ever come across this problem.

I have grab numerous feeds from different sites and never had a problem with languages changing.
Logged
The road the righteous travel is like the sunrise, getting brighter and brighter until daylight has come.

Jason Kingery

  • Sr. Member
  • ****
  • Karma: 1
  • Posts: 298
    • http://denial-design.com
Wrong language result when parsing external site
« Reply #2 on: October 18, 2006, 09:07:19 am »

Quote from: Grudgeuk
Absolutely bizarre problem you have there.

As Myspace is not even German cannot undestand how this has even happened.

Could it be a hosting or server problem converting it to German?   There is certainly no German in the Myspace source code.

I will dig a little more and see if any the guys I work with have ever come across this problem.

I have grab numerous feeds from different sites and never had a problem with languages changing.
I know, it is the strangest thing. Could be the server I'm on, but I wouldn't know why. Everything else is in english.

I'm stumped, thanks for the help.

Rob

  • Full Member
  • ***
  • Karma: 1
  • Posts: 219
    • http://www.ruthinweather.co.uk
Wrong language result when parsing external site
« Reply #3 on: October 18, 2006, 03:35:43 pm »

Right looks like your server is based in Germany but to confirm this, can you run the code on your local PC?
Logged
The road the righteous travel is like the sunrise, getting brighter and brighter until daylight has come.

Mika

  • Hero Member
  • *****
  • Karma: 9
  • Posts: 1377
    • http://www.ni5ni6.com/
Wrong language result when parsing external site
« Reply #4 on: October 18, 2006, 04:06:51 pm »

[topic title changed...blahblah :) - please use more descriptive titles]
Logged
http://www.ni5ni6.com/ - Tutorials, Mods and How-To's about sNews CMS
sNews 1.6 Developers Edition - commented sNews 1.6 version

Mika

  • Hero Member
  • *****
  • Karma: 9
  • Posts: 1377
    • http://www.ni5ni6.com/
Wrong language result when parsing external site
« Reply #5 on: October 18, 2006, 04:16:09 pm »

I've searched through the faq over at myspace but couldn't find anything about language settings. why don't you contact them or ask your friend nik (not a bad music if I may say so ;)) to give you the access to his profile - maybe there's something you've overlooked...
Logged
http://www.ni5ni6.com/ - Tutorials, Mods and How-To's about sNews CMS
sNews 1.6 Developers Edition - commented sNews 1.6 version