From f6de5fff498115e6b843a9922f45c82091830e98 Mon Sep 17 00:00:00 2001 From: Fabien Benetou Date: Mon, 25 Jul 2011 12:10:01 +0200 Subject: [PATCH] initial crude test --- shell_scripts/pmwiki_social_search | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 shell_scripts/pmwiki_social_search diff --git a/shell_scripts/pmwiki_social_search b/shell_scripts/pmwiki_social_search new file mode 100755 index 0000000..a3cfcc3 --- /dev/null +++ b/shell_scripts/pmwiki_social_search @@ -0,0 +1,19 @@ +#! /usr/bin/env bash +# motivated by + +# TODO +# upport some sort of caching +# example test1 for friend1, test2 for friend2 and test for friend1 and friend2 + +QUERY="?action=search&q=fmt%3D%23simple+" +# PmWiki format +KEYWORD=$1 +URList=("http://nicolas.bigand.free.fr/pmwiki/index.php5" "http://notes.franck-brignoli.fr/") +# all Pmwiki instances +for URL in "${URList[@]}" +# this should be limited to people with expertize in the topic +do + curl "${URL}${QUERY}${KEYWORD}" | awk /wikisearch/,/searchinfostart/ | grep wikilink | sed "s/.*href='\(.*\)'.*/\1/" | sort | uniq + # parsing is only done for PmWiki now +done +