mIRC Home    About    Download    Register    News    Help

Print Thread
socket connection to site issue #59665 10/11/03 12:55 AM
Joined: Jan 2003
Posts: 109
S
SpaceBoy Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jan 2003
Posts: 109
Hi

I have a script to retrieve headlines for my business channel and I'm trying to get it to work with this page:
http://framehosting.dowjonesnews.com/Home/Content_Main.asp?

The page dosn't require a login or anything to view on a browser, but when the script tries to get the line I want, all that is dumped into the variable is:

<body><h1>Object Moved</h1>This object may be found <a HREF="/NotLoggedIn.asp">here</a>.</body>

I've tried various combinations of the URL because there are longer versions of the address too when you right-click in IE and get the properties, but all return the same result. I'm wondering if there's some other kind of information the socket needs to send to get this particular page?

Thanks in advance for any assistance!


#Newsroom
Where News & Markets Connect
http://www.inewsroom.net
Re: socket connection to site issue #59666 10/11/03 02:02 AM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
When I click that link it tells me I need to login, so either you've got the link wrong or you do need to be logged in.

Re: socket connection to site issue #59667 10/11/03 02:04 AM
Joined: Jan 2003
Posts: 109
S
SpaceBoy Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jan 2003
Posts: 109
ah ok thanks - weird cos it's never asked me to login - just goes straight to the news.

thanks for checking though!


#Newsroom
Where News & Markets Connect
http://www.inewsroom.net
Re: socket connection to site issue #59668 10/11/03 07:40 AM
Joined: Oct 2003
Posts: 30
pleur Offline
Ameglian cow
Offline
Ameglian cow
Joined: Oct 2003
Posts: 30
that has to do with coockies


it's possible to request such a page though, it needs a bit of patiance and www.google.com (eerm, for searching a tut ofcourse) =:)


------
Cheers m8!
Re: socket connection to site issue #59669 10/11/03 07:44 AM
Joined: Jan 2003
Posts: 109
S
SpaceBoy Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jan 2003
Posts: 109
thanks but google won't help me here.


#Newsroom
Where News & Markets Connect
http://www.inewsroom.net
Re: socket connection to site issue #59670 10/11/03 10:43 AM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
When you are sending cookies to the server, they appear in this form:
  • Cookie: name=data; name=data
If you want to read your login information directly from the cookie file and send it along the HTTP request, you can put this code in your sockopen event, above the ending CRLF:
Code:
.fopen c c:\windows\cookies\user@[color:blue]&lt;cookie name&gt;[/color].txt
if $ferr {
  echo * Error: can't locate cookie file $fopen(c).fname
}
else {
  while !$feof {
    var %c = %c $+($fread(c),=,$fread(c),;)
[color:green]    ; move the pointer after the next '*'[/color]
    .fseek -r c \*
    .fseek -n c
  }
  sockwrite -n $sockname Cookie: %c
}
.fclose c

Re: socket connection to site issue #59671 11/11/03 04:40 AM
Joined: Jan 2003
Posts: 109
S
SpaceBoy Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jan 2003
Posts: 109
thanks Online - giving it a try now - though I'm getting the error message saying it can't find the file because the path has spaces in it:
C:\Documents and Settings\My Name\Cookies

tried underscores to fill in the gaps but it still can't locate it - any work arounds?
cheers.


#Newsroom
Where News & Markets Connect
http://www.inewsroom.net
Re: socket connection to site issue #59672 11/11/03 04:43 AM
Joined: Aug 2003
Posts: 1,831
I
Iori Offline
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Wrap it in "quotes"
"C:\Documents and Settings\My Name\Cookies\user@<cookie name>.txt"

Re: socket connection to site issue #59673 11/11/03 05:02 AM
Joined: Jan 2003
Posts: 109
S
SpaceBoy Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jan 2003
Posts: 109
thanks that bit now works - but after all that I'm still getting the not logged in message aghrrrrrr

oh wells!


#Newsroom
Where News & Markets Connect
http://www.inewsroom.net
Re: socket connection to site issue #59674 11/11/03 06:08 AM
Joined: Jan 2003
Posts: 109
S
SpaceBoy Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jan 2003
Posts: 109
if anyone can help any further, the base site the headlines are in is:
http://www.djnewswires.com

the frame in that page (which I assume the cookie is made from) can be launched into a separate window by right-clicking a headline and chose 'open in new window'. That's the page I'm trying to get the headlines from.

Thanks again - hope this can be cracked!! confused


#Newsroom
Where News & Markets Connect
http://www.inewsroom.net