mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2003
Posts: 109
S
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
Joined: Dec 2002
Posts: 3,138
C
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.

Joined: Jan 2003
Posts: 109
S
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
Joined: Oct 2003
Posts: 30
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!
Joined: Jan 2003
Posts: 109
S
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
Joined: Dec 2002
Posts: 1,922
O
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

Joined: Jan 2003
Posts: 109
S
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
Joined: Aug 2003
Posts: 1,831
I
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"

Joined: Jan 2003
Posts: 109
S
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
Joined: Jan 2003
Posts: 109
S
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

Link Copied to Clipboard