/[drupal]/contributions/tricks/fingerprints/is_drupal
ViewVC logotype

Contents of /contributions/tricks/fingerprints/is_drupal

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Thu May 21 14:08:52 2009 UTC (6 months, 1 week ago) by pwolanin
Branch: MAIN
CVS Tags: HEAD
Add is_drupal script
1 #!/usr/bin/env bash
2
3 # $Id$
4 # Given a list of websites, indicate wether each is a Drupal site
5 # Based on:
6 # http://www.lullabot.com/articles/is-site-running-drupal
7 # http://isthissitebuiltwithdrupal.com/
8
9 if [ -z $@ ]
10 then
11 echo "Makes a best guess as to whether each website is Drupal"
12 echo "Usage: $0 URL1 [URL2 ...]"
13 fi
14
15 for SITE; do
16 FIRST=$(curl -fsL $SITE/misc/drupal.js 2>&1 | grep -c -m 1 "Id: drupal.js,v")
17
18 if [ "$FIRST" != "1" ]
19 then
20 SECOND=$(curl -fsIL $SITE 2>&1 | grep -c -m 1 "Expires: Sun, 19 Nov 1978 05:00:00 GMT")
21 fi
22
23 if [ "$FIRST" == "1" -o "$SECOND" == "1" ]
24 then
25 echo "Yes: $SITE"
26 else
27 echo "No: $SITE"
28 fi
29 done
30

  ViewVC Help
Powered by ViewVC 1.1.2