[squeak-dev] [Q] How deal with unwanted looking to private stuff?

Edgar J. De Cleene edgardec2001 at yahoo.com.ar
Fri Jan 29 12:49:43 UTC 2010




On 1/29/10 8:17 AM, "Igor Stasenko" <siguctua at gmail.com> wrote:

> I think, you should define rules for bots in robots.txt file, and put
> there anything which you want robots to index, and what's not.
> See http://www.robotstxt.org/robotstxt.html

Fail, but the info is useful, thanks Igor
I attach my way to avoid Google using Comanche + HV

Edgar

-------------- next part --------------
'From MinimalMorphic of 8 December 2006 [latest update: #7246] on 29 January 2010 at 10:46:25 am'!

!HVNaughtieWiki methodsFor: 'urls' stamp: 'edc 1/29/2010 10:45'!
dispatchOn: method 
	"Dispatch to correct method:
	- If method is empty we call #default
	- If the selector is allowed to be executed then we just call it
	- If method is prefixed with 'src' and viewing the source is allowed,
	then we return a HTML page with the source for that method."
	| m who |
	who := self request headerAt: 'from'.
	who = 'googlebot(at)googlebot.com'  ifTrue: [ ^self serverError: 'Forbiden'].
	method isEmptyOrNil
		ifTrue: [^ self default].
	m := method asSymbol.
	(self allowedSelector: m)
		ifTrue: [^ self perform: m].
	"Is it a request for the source?"
	(m beginsWith: 'src')
		ifTrue: [m := (m asString last: m size - 3) asSymbol.
			(self allowedSrcSelector: m)
				ifTrue: [^ self showSourceFor: m]
				ifFalse: [^ self serverError: 'Not allowed to view source']]
		ifFalse: [^ self serverError: 'Specified URL: #' , method , ' not allowed']! !


More information about the Squeak-dev mailing list