Skip to content

Commit

Permalink
Getting there for 1st release - will automic commit later
Browse files Browse the repository at this point in the history
  • Loading branch information
409H committed Feb 3, 2018
1 parent 3924f8a commit cb876d4
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 489 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
8 changes: 0 additions & 8 deletions .idea/EtherSecurityLookup.iml

This file was deleted.

21 changes: 0 additions & 21 deletions .idea/deployment.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

43 changes: 0 additions & 43 deletions .idea/watcherTasks.xml

This file was deleted.

400 changes: 0 additions & 400 deletions .idea/workspace.xml

This file was deleted.

2 changes: 1 addition & 1 deletion js/TwitterFakeAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class TwitterFakeAccount

var objAlertDiv = document.createElement("div");
// @todo - Maybe link to the account it's similar to? https://twitter.com/intent/user?user_id=XXX
objAlertDiv.innerText = "⚠️This Twitter account might be fake! (very similar name to @"+ objData.similar_to +")";
objAlertDiv.innerText = "⚠️This Tweet might be from a fake account! (very similar name to @"+ objData.similar_to +")";
objAlertDiv.style = "color:white;background:red;text-align:center;margin-bottom:1%;font-weight:600;width:100%;border-top-left-radius:1em;border-top-right-radius:1em;top:-5px;position:relative;left:-5px;padding:5px;";
objNode.insertBefore(objAlertDiv, objNode.firstChild);
}
Expand Down
10 changes: 8 additions & 2 deletions js/workers/TwitterFakeAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ class TwitterFakeAccount
3278906401: "metamask_io",
574032254: "coinbase",
19748227: "mewtant_",
878924739812761600: "QuikNode"
878924739812761600: "QuikNode",
831847934534746114: "omise_go",
887708494832451584: "concourseqio"
};
this.arrViewBlacklistedUserIds = [];
this.arrViewWhitelistedUserIds = [];
Expand All @@ -62,7 +64,11 @@ class TwitterFakeAccount

//Check the username against the whitelist with levenshtein edit distance
for(var intKey in this.objWhitelistedHandles) {
//console.log(strUsername + " checking against: "+ this.objWhitelistedHandles[intKey]);
if(strUsername.toLowerCase() === this.objWhitelistedHandles[intKey].toLowerCase()) {
return {
"result":false
};
}
var intHolisticMetric = this.levenshtein(strUsername, this.objWhitelistedHandles[intKey]);
if (intHolisticMetric <= this.intMaxEditDistance) {
//Add it to the array so we don't have to do Levenshtein again
Expand Down

0 comments on commit cb876d4

Please sign in to comment.