Computing.Net > Forums > Programming > How can i do this?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

How can i do this?

Reply to Message Icon

Name: mark1221
Date: January 7, 2004 at 11:31:45 Pacific
OS: Win XP
CPU/Ram: 512
Comment:


A certain site has this script :

<script language="JavaScript">
var forumid=3;
var forum_name="Halflife & Counter-Strike";
var Description="זה הזמן להצטרף לשחקני CS הישראלים!";
var sticky_message_text='חשוב: ';
var fstatus=1;
var skin=0;
var page=0;
var hot_topic=25;
var topics=6373;
var topics_per_page=25;
var replys_per_page=15;
var archive=0;
var channel=1;
var karma=11;
var credits=0;
var super_credits=0;
var rank='1';

i need my program to get the variable karma and display the value (in this case - 11) how can i do this?



Sponsored Link
Ads by Google

Response Number 1
Name: SN
Date: January 7, 2004 at 12:48:09 Pacific
Reply:

1. Choose a programming language (almost any popular one can do this...Perl, php, C, C++, Java, VisualBasic, etc.
2. open a socket to to site, read in the page
3. Extract the data using a regular expression

-SN


0

Response Number 2
Name: mark1221
Date: January 7, 2004 at 20:51:53 Pacific
Reply:

can you be more detailed?
i'm kinda new to this...


0

Response Number 3
Name: anonproxy
Date: January 7, 2004 at 21:48:43 Pacific
Reply:

Your scraping data from a website. Often called simply webscraping.

Write a program on your web server which runs regularly. Here is how it should go.

1) This program should first open a connection the website to download the file with the information you want.

2) Next, the program searches the file for specific characters like "var rank='1'". You can use regular expressions, which are search queries for characters. You save the specific characters to a variable.

3) Your script writes this variable to a file/database.

4) Another script reads this data from the file/database and writes it to an html (maybe the script is embedded in the html file and dynamically includes the data in the html file before it is sent).

This is a very popular tutorial for web scraping with regular expressions in Python.


0

Response Number 4
Name: Dave The Snakes
Date: January 9, 2004 at 10:21:11 Pacific
Reply:

I think you are double posting under a different name--like GRAHAM for example--dont try to be smart fartface


0

Response Number 5
Name: anonproxy
Date: January 9, 2004 at 11:18:35 Pacific
Reply:

"I think you are double posting under a different name"

You're entitled to think what you want. If you intend to make a point about it, you should provide examples.


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon

call unix commands throug... changing ie's footer via ...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: How can i do this?

How can I do this? www.computing.net/answers/programming/how-can-i-do-this/8766.html

in visual basic.net can i do this.? www.computing.net/answers/programming/in-visual-basicnet-can-i-do-this/12729.html

How do I do this in Batch?? www.computing.net/answers/programming/how-do-i-do-this-in-batch/11238.html