d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Java/javascript Question...
Add Reply New Topic New Poll
Member
Posts: 15,666
Joined: Jul 15 2007
Gold: 3,046.40
Aug 7 2012 06:14pm
How to make a Java// Javascript function that will read a website and simulate a button press...

for example:

read d2jsp website
find button [Topic Tracker]
press button [Topic Tracker]


Is this possible? or is this considered illegal (I've read snippets about cross-website calling and how it's frowned upon due to security reasons)

Thanks in advance. :)
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Aug 7 2012 07:59pm
if you're asking specifically about jsp, keep in mind what the jsp rules are for whatever you're doing

http://forums.d2jsp.org/info.php?p=9

Quote
Prohibited behavior and content (text, links, images, videos etc.):
No flaming, insults, racism, degrading content, bullying, intimidation, harassment, or threats.
No discussion of illicit drugs or narcotics.
No spamming or trolling. All topics and replies must be on topic and relevant to the discussion content and sub-forum it is created under.
No nudity, pornography, or sexually suggestive content.
No gratuitous violence.
No violations of the law.
No usage of another user's personal pictures or information without express permission.
No impersonating another user or person.
No swearing in topic titles, user names, guild names, photo gallery titles, or other similar features.
No referral links (monetary or otherwise).
No piracy, copyright infringement, or plagiarism.
No binaries, hacks, bots, exploits, or third party modifications of any game or program.
No advertising or linking to any external site that has not otherwise been expressly authorized. This includes mislabeled or deceptive links (including tools to shorten or obfuscate a link).
No stealing or scamming from other users within or outside of d2jsp, for any real or virtual goods.
No multiple accounts - only one account per person is allowed. You may not under any conditions create more than one account per person.
No sharing of accounts - only one person per account is allowed.
No monetary sales of anything on, from, or through this site, including, but not limited to: accounts, virtual goods, forum gold, CD-keys.
No begging or requesting donations for any real or virtual goods, including, but not limited to, forum gold or money.
No trading or selling of real life items outside of the Donor Forum.
No botting or automation of any features within d2jsp, including, but not limited to, posting, page refreshing, Ladder Slasher.
No encouraging, helping, or facilitating of others to violate site rules or policies.


if you're asking in general how to do it, then it depends on what you want. in the Track Topic example, it makes a GET request with the specific topic id to bring you to another page, then makes a POST request after you select your days and notes. the easiest way for this kind of thing would be to simply submit POST data with your own program. you will do it this way for anything that has forms that are submitted.

this will cut the user interaction and submit the form. if on the other hand you have a pure javascript call, eg press a button and all your user controls float around in a cool pattern or a popup comes up, then this will not work. if you want to actually click the button on your screen, then i'd suggest looking at greasemonkey scripts.

i find that python's mechanize was very easy to use. you can also use other virtual browsers, i'm sure java has one.

This post was edited by carteblanche on Aug 7 2012 08:08pm
Member
Posts: 15,666
Joined: Jul 15 2007
Gold: 3,046.40
Aug 7 2012 11:01pm
Quote (carteblanche @ Aug 7 2012 05:59pm)
if you're asking specifically about jsp, keep in mind what the jsp rules are for whatever you're doing

http://forums.d2jsp.org/info.php?p=9



if you're asking in general how to do it, then it depends on what you want. in the Track Topic example, it makes a GET request with the specific topic id to bring you to another page, then makes a POST request after you select your days and notes. the easiest way for this kind of thing would be to simply submit POST data with your own program. you will do it this way for anything that has forms that are submitted.

this will cut the user interaction and submit the form. if on the other hand you have a pure javascript call, eg press a button and all your user controls float around in a cool pattern or a popup comes up, then this will not work. if you want to actually click the button on your screen, then i'd suggest looking at greasemonkey scripts.

i find that python's mechanize was very easy to use. you can also use other virtual browsers, i'm sure java has one.


yeah for sure with the no automation thing, i was just using jsp as an object for example.
but i see where the problem lies, thanks for your post, it helped me out.
Member
Posts: 7,077
Joined: Feb 11 2006
Gold: 4,330.43
Sep 7 2012 01:24pm
read about "document.createEvent()" method for javascript, that is very possible

edit: better use jQuery

This post was edited by drunk. on Sep 7 2012 01:25pm
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll