{"id":15584297,"url":"https://github.com/ableinc/scoresystem","last_synced_at":"2025-07-26T12:11:17.948Z","repository":{"id":63217472,"uuid":"566131781","full_name":"ableinc/ScoreSystem","owner":"ableinc","description":"Detect verified parody Twitter accounts","archived":false,"fork":false,"pushed_at":"2022-11-16T03:42:04.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-03T23:31:27.159Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ableinc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-15T02:53:55.000Z","updated_at":"2022-11-15T02:55:56.000Z","dependencies_parsed_at":"2023-01-23T08:15:13.500Z","dependency_job_id":null,"html_url":"https://github.com/ableinc/ScoreSystem","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ableinc%2FScoreSystem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ableinc%2FScoreSystem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ableinc%2FScoreSystem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ableinc%2FScoreSystem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ableinc","download_url":"https://codeload.github.com/ableinc/ScoreSystem/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246162117,"owners_count":20733355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T20:40:38.690Z","updated_at":"2025-03-29T08:44:52.464Z","avatar_url":"https://github.com/ableinc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ScoreSystem - Detect Parody Twitter Accounts\n\n## About\n\nRecently, Elon Musk has purchased Twitter and allowed any user to have a verified (blue check mark) Twitter account, when subscribing to the Twitter Blue plan. In the wake of this change, a number of parody accounts sprung up. These imposter accounts were behaving as the real accounts, for real businesses, and causing their own trouble. This repo contains a very simple algorithm (ScoreSystem) that can detect accounts posing as legimately, verified business accounts.\n\nNote: ***This is a PoC (proof of concept)***\n\n## Payload\n\nBelow is the payload we'll be using for our demonstration. Based on the ```noteFromDeveloper``` property, you can determine which accounts are meant to be parodies and which are meant to be real.\n\n```javascript\n{\n    username: \"whoIef00ds\",\n    name: \"Whole Foods\",\n    biography: \"The official Twitter account for the Whole Foods brand. Parody.\",\n    noteFromDeveloper: \"This is a paraody account with improper parody labels.\"\n},\n{\n    username: \"j0hn50n4ndjohnson\",\n    name: \"Johsnon \u0026 Johnson Parody\",\n    biography: \"The official Twitter account for Johnson \u0026 Johnson. A global leader in healthcare. Parody.\",\n    noteFromDeveloper: \"This is a parody account with proper parody labels.\"\n},\n{\n    username: \"foodlionus\",\n    name: \"Food Lion\",\n    biography: \"The official Twitter account for Food Lion. A southeastern grocery store chain.\",\n    noteFromDeveloper: 'This is a real account.'\n}\n```\n\n## How to Use\n\nRun this in your terminal:\n\n```bash\nnode index.js\n```\n\n## The Database\n\nThe database in this example can be found in the ```db.json``` file. This database contains 2 real twitter accounts.\n\n## Similar Characters JSON\n\nThe ```similarCharacters.json``` file is a very simple key value pairing of similar letters and numbers, commonly used on the internet. You can add to this - replacing null values is important. The algorithm doesn't utilize this as much as it could, but further iterations of the code could include full utilization.\n\n## Client Data JSON\n\nThe ```clientData.json``` file is an array of client payload data. This mock client payload data is suppose to mimic a real account creation request, with a few properties removed. If you'd like to experiment with new usernames, please copy an existing object, update it and add it to the array.\n\n## The Scenario\n\nThe scenario is such: A user (not an automated bot) is creating a new account. This user has malicious intent and is trying to create a parody account to impersonate a real, verified (Twitter termoniolgy) business. The ScoreSystem algorithm will use the information provided by the user and try to determine if the account is real or a parody.\n\n## Results - Strict mode\n\nRunning this, as is, should result in 2 \"Account creation\" failures and 1 success. Use this to measure against any changes you make.\n\n```bash\nAPI Response:  {\n  message: 'Account creation failed. This is a parody account.',\n  status: 400,\n  requestBody: {\n    username: 'whoIef00ds',\n    name: 'Whole Foods',\n    biography: 'The official Twitter account for the Whole Foods brand. Parody.',\n    noteFromDeveloper: 'This is a paraody account with improper parody labels.'\n  }\n}\nAPI Response:  {\n  message: 'Account creation failed. This is a parody account.',\n  status: 400,\n  requestBody: {\n    username: 'j0hn50n4ndjohnson',\n    name: 'Johsnon \u0026 Johnson Parody',\n    biography: 'The official Twitter account for Johnson \u0026 Johnson. A global leader in healthcare. Parody.',\n    noteFromDeveloper: 'This is a parody account with proper parody labels.'\n  }\n}\nAPI Response:  { message: 'Successfully created new user.', status: 200 }\n```\n\n## Results with ALLOW_PARODY_LABEL env variable - Free mode\n\nRunning this, with ```ALLOW_PARODY_LABEL=true```, should result in 1 \"Account creation\" failures and 2 successes. Use this to measure against any changes you make.\n\n```bash\nAPI Response:  {\n  message: 'Account creation failed. This is a parody account.',\n  status: 400,\n  requestBody: {\n    username: 'whoIef00ds',\n    name: 'Whole Foods',\n    biography: 'The official Twitter account for the Whole Foods brand. Parody.',\n    noteFromDeveloper: 'This is a paraody account with improper parody labels.'\n  }\n}\nAPI Response:  { message: 'Successfully created new user.', status: 200 }\nAPI Response:  { message: 'Successfully created new user.', status: 200 }\n```\n\n## Notes\n\n- It should be understood that this implementation alone should not and could not be used to 100% verify the authenticity of an account. Humans are always the better judges. (lets debate about it)\n- This algorithm only takes into account a factors and simply calculates the probability that a \"new\" username is a parody of a real account username.\n- Feel free to use this and expand on it, but please give credit where credit is due.\n- It would not make sense to implement this at the Sign Up/Register view, as this is a heavily blocking implementation. You'd want to have this run as a cron service.\n- You may notice redundancy, but doing this after my morning meetings, 3 cups of coffee and an hour break during work, I decided to do this and not do it perfectly. Have at it with your own implementation :)\n- Everyone is a critic, so please be formal and write an Issue on the repo :)\n- I will not accept PR requests, as the repo will not be maintained. I support any and all forks! - Fork responsibly!\n\n## ScoreSystem Algorithm\n\nEach character in the username is valued at 2 points (defined by ```this.charValue``` in the ```constructor```). Any character that is a replacement (similar) character to the character that should be expected is called an \"offset\" (defined by ```this.offset``` in the ```constructor```), and is valued at -1 point. You may ask, how can you have a point less than 0? This was chosen for simple summation using Arrays. You could easily have the offset valued at 1 point, but you'd need to update the code to subtract the offset, rather than only add (i.e. 2 + -1 === 2 - 1). Your choice. Please read code blocks for function descriptions.\n\n## Changelog\n\n- ***November 15th 2022*** - Elon Musk will allow verified parody accounts, but they must explicitly say \"PARODY\" in their name and bio. The ```ALLOW_PARODY_LABEL``` environment variable will allow you to toggle between strict or free mode. Strict mode = ```ALLOW_PARODY_LABEL=false``` \u0026 Free mode = ```ALLOW_PARODY_LABEL=true```.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fableinc%2Fscoresystem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fableinc%2Fscoresystem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fableinc%2Fscoresystem/lists"}