{"id":19627053,"url":"https://github.com/brookr/hovercard-injection-tool","last_synced_at":"2026-05-14T11:31:07.705Z","repository":{"id":66661738,"uuid":"562836","full_name":"brookr/hovercard-injection-tool","owner":"brookr","description":"The Hovercard element on twitter.com provides some interesting possibilities. Load in your own data!","archived":false,"fork":false,"pushed_at":"2010-03-22T09:14:30.000Z","size":85,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-09T12:52:28.193Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brookr.png","metadata":{"files":{"readme":"README.rdoc","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-03-15T05:35:00.000Z","updated_at":"2014-01-15T01:48:59.000Z","dependencies_parsed_at":"2023-02-20T08:35:14.220Z","dependency_job_id":null,"html_url":"https://github.com/brookr/hovercard-injection-tool","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/brookr%2Fhovercard-injection-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brookr%2Fhovercard-injection-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brookr%2Fhovercard-injection-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brookr%2Fhovercard-injection-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brookr","download_url":"https://codeload.github.com/brookr/hovercard-injection-tool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240926398,"owners_count":19879737,"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-11-11T11:48:21.012Z","updated_at":"2026-05-14T11:31:07.656Z","avatar_url":"https://github.com/brookr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Hovercard Injection Tool - Bettering twitter.com\n\nTwitter.com now uses \"Hovercards\" to show user data when you mouse-over a \n@username. Using the Hovercard Injection Tool, you can load your own custom content into these\nhovercards to make them behave as you like.\n\n== It's Your Event\n\nInjection works by triggering a 'HIT_it' event when the hovercard is loaded, passing \nin the @username for that card. Define your own event; it will be called each\ntime a hovercard is displayed:\n\n  $('.hovercard').bind('HIT_it', function(e, screen_name) {\n    //my code\n  })\n\nWhenever you are done processing, hide the provided loading spinner:\n\n  $('#HIT-spinner').hide()\n\n== It's Your Data\n\nYour custom event can do anything you would like, but you probably want to\nstick some data based on that screen_name into the hovercard. Since jQuery\nis preloaded by twitter.com, you can easily add to the contents of the \ndefault HIT div that is already injected with the html() function:\n\n  $('.hovercard').bind('HIT_it', function(e, screen_name) {\n    $('#HIT').append(\n      '\u003cp\u003erah rah ah ah ah ' + screen_name + ' gah gah ooh la la\u003c/p\u003e'\n    )\n    $('#HIT-spinner').hide()\n  })\n\nHere is a (crude) way to get some relevant info from a remote server:\n\n  $('.hovercard').bind('HIT_it', function(e, screen_name) {\n    $('#HIT').append('\u003ch3\u003eRecent Web-wide Activity:\u003c/h3\u003e\u003cdiv id=\"goog\"\u003e\u003c/div\u003e')\n    $('#HIT #goog').html(\n      '\u003ciframe src=\"http://www.google.com/gwt/x?u=http://www.google.com/search%3Fq%3D@' + screen_name + '\" height=\"200\" width=\"275\"\u003e \u003c/iframe\u003e'\n    )\n    $('#HIT-spinner').hide()\n  })\n\nIf the remote server supports JSONP, you can do away with the iframe. For a \ncomplete description, see: http://www.ibm.com/developerworks/library/wa-aj-jsonp1/\n\n  \n== Use It Your Way\n\nYou might want to work this into a greasemonky script or bookmarklet? It is \nprobably too long to fit into a straight bookmarklet, so you would need to \nhost your js file (that contains HIT combined with your event binding and \ndata processing). Once the files is hosted somewhere, you can build your\nbookmarklet (see the great instructions at BetterExplained.com[http://betterexplained.com/articles/how-to-make-a-bookmarklet-for-your-web-application/]).\n\nThe bookmarklet could then be used by navigating to twitter.com and clicking\nthe bookmarklet once to load in your script. All hovercards will then get your\nspecial treatment.\n\n== Testing\n\nThe easiest way to use HIT is to paste it into a browser console. In Firefox\n(with Firebug) or a WebKit browser (Safari, Chrome), you can access a command-\nline interface that lets you run javascript directly. Pop that open, paste in\nthe HIT code, and then start experimenting! You can simply reload and re-enter\nyour event binding as much as you'd need to keep tweaking it.\n\n= Other Stuff\n\nAuthor::  @brookr[http://twitter.com/brookr] of @decielo[http://twitter.com/decielo]\nLicense:: Original code Copyright 2010 by Brook Riggio.\n          Released under an MIT-style license.  See the LICENSE  file\n          included in the distribution.\n\n== Permission, License, Warranty\n\nPlease, use this. Change it. Tweak it. Build on it.\n\nIn return: let me know how you are using it? I'd love to hear your ideas.\n\nThis software is provided \"as is\" and without any express or\nimplied warranties, including, without limitation, the implied\nwarranties of merchantibility and fitness for a particular\npurpose.\n\n  ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrookr%2Fhovercard-injection-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrookr%2Fhovercard-injection-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrookr%2Fhovercard-injection-tool/lists"}