views:

534

answers:

3

As far as I'm aware, search engines (on the web) typically index only the "user facing" content of a web page.

But what if you wanted to find pages(s) that contain a certain fragment of HTML or JavaScript. Is this possible?

Do any web-wide search engines provide this feature? Or do you think that it would not be worth implementing?

+3  A: 

Yes, see Google Code Search and Koders. There are probably others. The Google page does seem to index code that appears on sites, try the lang:html & lang:javascript commands.

[Correction] It doesn't look like these sites index code within a site's source, only what is displayed on pages.

Dana the Sane
Do they index the source code of 'live' web pages on the internet? It doesn't appear to be so
frou
I think you're right, I tried a few lookups and didn't find results. If you already had a search engine index though, I don't think this would be terribly difficult to implement. Not sure why this isn't already available from Google.
Dana the Sane
+1  A: 

Not sure about the JavaScript, but I'm reasonably certain about any content in the HTML. I do some work with an open-source forum package, and while the version number is in a tool-tip, you can Google for the version number and see everyone who's using it (that's been indexed, natch.)

AnonJr
+1  A: 

Opera has built a search engine for web page code, although it's not public yet called Metadata Analysis and Mining Application or MAMA, but they do have some interesting statistics/findings.

Darryl Hein