From 5b3f050fd6f30f6b7bd945f6f4dc2f6811830c60 Mon Sep 17 00:00:00 2001 From: "Chakib (Spike) Benziane" Date: Sat, 14 May 2011 14:57:11 +0200 Subject: [PATCH] initial commit --- .scrapy/scrapy.db | Bin 0 -> 4096 bytes PyGoogleSearch/__init__.py | 0 PyGoogleSearch/__init__.pyc | Bin 0 -> 164 bytes PyGoogleSearch/items.py | 13 +++++++ PyGoogleSearch/items.pyc | Bin 0 -> 522 bytes PyGoogleSearch/pipelines.py | 8 +++++ PyGoogleSearch/settings.py | 16 +++++++++ PyGoogleSearch/settings.pyc | Bin 0 -> 438 bytes PyGoogleSearch/spiders/__init__.py | 8 +++++ PyGoogleSearch/spiders/__init__.pyc | Bin 0 -> 172 bytes PyGoogleSearch/spiders/google_spider.py | 40 +++++++++++++++++++++ PyGoogleSearch/spiders/google_spider.pyc | Bin 0 -> 1713 bytes README | 8 +++++ pygs | 42 +++++++++++++++++++++++ scrapy.cfg | 11 ++++++ 15 files changed, 146 insertions(+) create mode 100644 .scrapy/scrapy.db create mode 100755 PyGoogleSearch/__init__.py create mode 100644 PyGoogleSearch/__init__.pyc create mode 100644 PyGoogleSearch/items.py create mode 100644 PyGoogleSearch/items.pyc create mode 100644 PyGoogleSearch/pipelines.py create mode 100644 PyGoogleSearch/settings.py create mode 100644 PyGoogleSearch/settings.pyc create mode 100755 PyGoogleSearch/spiders/__init__.py create mode 100644 PyGoogleSearch/spiders/__init__.pyc create mode 100644 PyGoogleSearch/spiders/google_spider.py create mode 100644 PyGoogleSearch/spiders/google_spider.pyc create mode 100644 README create mode 100755 pygs create mode 100644 scrapy.cfg diff --git a/.scrapy/scrapy.db b/.scrapy/scrapy.db new file mode 100644 index 0000000000000000000000000000000000000000..423a5b96f570a538131dd8b4c89711087cd0af89 GIT binary patch literal 4096 zcmeH|%}T^D5XY0ItRU>Ur@~woR!~It1zeZj_M-M)QadiecDtLV(jGkce7=RRp$F5| zKp|>q9-?&|LA<`(M$o?nOO=7z z8{DCWgI0yqExcfR*(Ie`rUi{M|1A|*RdR=r=4E;j^H~sv{Ou(CRN5Aeshsx)g02cn z+ZnoxL#bDp*MD8Fy;-mcIaB)#o9dX`y-s9p%2S@WM#+tfgdKuE?~dYq=97& literal 0 HcmV?d00001 diff --git a/PyGoogleSearch/__init__.py b/PyGoogleSearch/__init__.py new file mode 100755 index 0000000..e69de29 diff --git a/PyGoogleSearch/__init__.pyc b/PyGoogleSearch/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b3b895c3753db73dc8e2279c1cce8ffe8ece780f GIT binary patch literal 164 zcmcckiI8(! literal 0 HcmV?d00001 diff --git a/PyGoogleSearch/items.py b/PyGoogleSearch/items.py new file mode 100644 index 0000000..791a003 --- /dev/null +++ b/PyGoogleSearch/items.py @@ -0,0 +1,13 @@ +# Define here the models for your scraped items +# +# See documentation in: +# http://doc.scrapy.org/topics/items.html + +from scrapy.item import Item, Field + +class PyGSItem(Item): + # define the fields for your item here like: + # name = Field() + title = Field() + link = Field() + desc = Field() diff --git a/PyGoogleSearch/items.pyc b/PyGoogleSearch/items.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2a6f006a7b6d49ca172372d5fc80dfeee394d7e5 GIT binary patch literal 522 zcmcIgJ5Izf5FI<&6}t%0aRHiCYYu=Aq5y#eLP>bI{uIX0{246!lb(e=?|De zUSw1T*_=Yu)4Ho#)H*DQ(Yo!;v!gU;+1NVR;4r#zwre6V=%Xa`pZV1=d0gmIN(uPmo~qAC z9P*J9d12y)+)wU3M+n^^ITBRtjCl|ah`}GAPn0e4wPLi#t71i&zo=9r!}&%&s_wbxqMrxn>P7a5707NX4@b%egJvDYzqJY literal 0 HcmV?d00001 diff --git a/PyGoogleSearch/spiders/__init__.py b/PyGoogleSearch/spiders/__init__.py new file mode 100755 index 0000000..c930799 --- /dev/null +++ b/PyGoogleSearch/spiders/__init__.py @@ -0,0 +1,8 @@ +# This package will contain the spiders of your Scrapy project +# +# To create the first spider for your project use this command: +# +# scrapy genspider myspider myspider-domain.com +# +# For more info see: +# http://doc.scrapy.org/topics/spiders.html diff --git a/PyGoogleSearch/spiders/__init__.pyc b/PyGoogleSearch/spiders/__init__.pyc new file mode 100644 index 0000000000000000000000000000000000000000..01efa2da1aee368ba8a935a29ac34e753d205d12 GIT binary patch literal 172 zcmcckiI3t?KhOOo2ETSGRGumH01ZqM}GM0Xnb<={^x@B&j|lBG_!#z@e{Nr zQi4)J%A?dH!LuH%2c&#T{eC>4bwDblH0;Mdt%sBjU50?x2c$-njxK#;O2<@&Bn2%5 zl|%Z2=pE5-=`|{Snnwp%y!snY;kSj`xFpflD?*Og}<1&tW7n2|y1L zKubDcyF|w)8ITN_m2vI(8j0OL|DzJSL)}yWK?a=Y40&tHVy8$hUc0O%1 zZ3pzj>5_HNvy ziivr|T77}tV9(#c#Bo`@?K!Bx(Bw4MDpr-5!MD2qYF4P+n1_=Njy$&DDEjtz%luzH z|A~_IKF|h8Vk@hps|ObP=wRAPX$o`a|CX7pI=OIqRZwTdJiC#tYUy$sC1sm123Hf~ zG@5Wy%fZ+s>)HA8wv|nJl>@O0S7d-~bz`LEG^>s26Qj<3j|*%x;i(A0T(%c <%s>' % (scrapy, + search) + p = subprocess.Popen([ + scrapy, scrapy_cmd, + search, '--set', + 'FEED_URI=data.json', + '--set', + 'FEED_FORMAT=JSON' + ], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + output = p.communicate()[0] + print output diff --git a/scrapy.cfg b/scrapy.cfg new file mode 100644 index 0000000..de5a1a7 --- /dev/null +++ b/scrapy.cfg @@ -0,0 +1,11 @@ +# Automatically created by: scrapy startproject +# +# For more information about the [deploy] section see: +# http://doc.scrapy.org/topics/scrapyd.html + +[settings] +default = PyGoogleSearch.settings + +[deploy] +#url = http://localhost:6800/ +project = PyGoogleSearch