Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Help Wanted! Bookmarklet script for catching scammers (Mafia Wars/Facebook)

    Hi,

    It would be easier to explain this if you play mafia wars (or any game that includes intra-game exchange of gifts/items between members) but the actual scripting doesn't require any knowledge of the game.

    Background Information

    Mafia Wars is a game on Facebook (and myspace, yahoo etc.) that among other things allows its players to send gifts to each other. Now because different people end up with more things of one type and are short of things of another type, the players have evolved a trading dynamic. Where x number of Item 1 is traded for y number of Item 2. A simple marketplace. And with this territory come scammers. Essentially a player who doesn't go through with his end of the deal. good player sends item to bad player. bad player removes good player from mafia and blocks him for ever contacting him through his facebook profile.

    This has given rise to my group, among many others, that lists these scammers (identified with their facebook profile ids) as they are reported every day. Now over time the list has grown and it has become difficult and unrealistic to expect people to know who is on the list and who is not.

    The Requirement

    A javascript bookmarklet (there are many already servicing different needs of the players) that sits on the browser and tells the user if the person he is about to trade with is a listed scammer or not.

    The Breakdown

    The user will click the bookmarklet when he is on the facebook profile of the person he is about to trade with. When clicked the script will pull the facebook profile id from the current page, and then scan a text file located on a third-party server and return with a pop-up box message that reports if the id is listed as a scammer or not.

    It should be pretty simple to do, except I don't know the first thing about javascript coding. So if there's anyone who can devote a few hours/days to help us out with this it would be greatly appreciated.

    Thank you.

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,144
    Thanks
    203
    Thanked 2,547 Times in 2,525 Posts
    JavaScript is purely a client-side language, and unless used with an Ajax call has no capability to read from or write to a file (except a cookie), communicate with the server, access a database or the client's operating system, or alter the default behaviour of the browser. And for security reasons JavaScript cannot access anything beyond the domain of the current page. This is known as the "same origin policy" and prevents a document or script loaded from one origin from getting or setting properties of a document from a different origin.

  • #3
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Philip,

    Thank you for taking the time to clarify this mistake on my part. Assuming Ajax is a compiler(?) on the server-side, then is it possible for the js code (executed when the bookmarklet is clicked) to take the id from the current page and send it as part of some form delivery mechanism to a program on the server that then scans the text file and reports back with a pop-up window message?

    As you can tell, I'm vague about the actual process but have a tenuous grasp of what needs to happen from a purely external viewpoint.

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,144
    Thanks
    203
    Thanked 2,547 Times in 2,525 Posts
    Quote Originally Posted by patrickmonahan View Post
    Hi Philip,

    Thank you for taking the time to clarify this mistake on my part. Assuming Ajax is a compiler(?) on the server-side, then is it possible for the js code (executed when the bookmarklet is clicked) to take the id from the current page and send it as part of some form delivery mechanism to a program on the server that then scans the text file and reports back with a pop-up window message?

    As you can tell, I'm vague about the actual process but have a tenuous grasp of what needs to happen from a purely external viewpoint.

    No. As I said, Javascript is purely a client-side language and cannot communicate with the server.

  • #5
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is there anyway then for the script to construct a url that basically submits a form/loads a url (e.g. safecheck.com/scanme.php?id=123456, where 123456 is the facebook id) in the background to a program on the server, the program gets the id through the form/url attribute, runs the scan on a textfile and then returns a message to the browser that is then displayed in a js pop-up window?

    Quote Originally Posted by Philip M View Post
    No. As I said, Javascript is purely a client-side language and cannot communicate with the server.
    Last edited by patrickmonahan; 12-10-2009 at 01:34 PM.

  • #6
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,144
    Thanks
    203
    Thanked 2,547 Times in 2,525 Posts
    See Post #4.

    Recursion - see recursion

  • #7
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The bookmarklet is ready and the system is live!

    Check it out at http://mwtsn.biz.nf/index.php

    cheers!


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •