View Full Version : How do I do this?
Force
September 22nd, 2002, 10:58
does anyone know how to make a script that goes to a page and gets one line (example: line 34) off that page every 24 hours. then it puts that line into a text file on my site. i know how to set up cron, but dont know how to make this.
thanks in advance
xzx2
September 22nd, 2002, 11:58
Originally posted by Force
does anyone know how to make a script that goes to a page and gets one line (example: line 34) off that page every 24 hours. then it puts that line into a text file on my site. i know how to set up cron, but dont know how to make this.
thanks in advance
You don't need cron for that, A simple javascript will work:
function getCookie(Name) {
var search = Name + "="
if (document.cookie.length > 0) { // if there are any cookies
offset = document.cookie.indexOf(search)
if (offset != -1) { // if cookie exists
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset)
// set index of end of cookie value
if (end == -1)
end = document.cookie.length
return unescape(document.cookie.substring(offset, end))
}
}
}
var expdate = new Date((new Date()).getTime() + 86400000);
var cookieval = getCookie("popcounter");
if (cookieval==undefined) {
document.cookie="popcounter=1; expires=" + expdate.toGMTString() + "; path=/;";
// 1st line
document.write("Whatever you want it to do");
}
this is a popup script that i use, every 24 hours it pops up. I edited it up a bit. All you need to do is call it with a .js extension from the file that you want. You can use iframes for that...
Force
September 22nd, 2002, 12:14
did you even read my post!!! damn newbies! i want it to go to a page like yahoo.com and get line 34 and write it to a file on my website. it has NOTHING to do with cookies.
xzx2
September 22nd, 2002, 12:29
Originally posted by Force
did you even read my post!!! damn newbies! i want it to go to a page like yahoo.com and get line 34 and write it to a file on my website. it has NOTHING to do with cookies.
dude, i ain't a n00b first thing. Second, i ain't gonna edit it for you all the way, since you didn't give specifics. 3rd, drop the (censored) attitude. and it does have everything to do with cookies you (censored) noob!!!!
Force
September 22nd, 2002, 19:47
no matter how you edit a javascript, you can never get it to write to a file to my site or do anything else i wanted it to do.
xzx2
September 22nd, 2002, 21:09
use iframes and document.write(" ");
keith
September 22nd, 2002, 21:20
javascript is pretty lame.
xzx2
September 22nd, 2002, 21:54
Originally posted by keith
javascript is pretty lame.
true, and i wouldn't really advise going with the method that i told him, but since no one else was replying, i posted it. Too bad i didn't know how gratefull he would be:
Originally posted by Force
did you even read my post!!! damn newbies! i want it to go to a page like yahoo.com and get line 34 and write it to a file on my website. it has NOTHING to do with cookies.
If i knew that was his response i would told him to go to hell...
Force
September 25th, 2002, 20:40
the script you gave me cannot do what i wanted. even using an iframe would not work. this would include the whole page. let me say this again, i only want one line of code from the entire page. a javascript also cannot create files. it can write to a page, but that would only be for the person viewing it, i need it to create a new file.
Kaliber
September 27th, 2002, 10:13
shut up force, go get some respect, if someone does something for you you thank them but then explain the problem.
Force
September 27th, 2002, 19:22
the reason why i was so mean, was because when i first saw his post and that he only had a post count of one I thought he was just trying to spam by posting irrelavant stuff. sorry xzx2 if I was being annoying to you, but i hope you can understand what i was thinking.
i dont think anyone here knows how to do this, so a mod can close this if he or she wants.
Kaliber
September 27th, 2002, 20:56
HAHA, no one spends 10 mins on a janascript hoping to raise their post level.
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.