Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changed the yahoo search app id

  • Loading branch information...
commit a6a1956621ace2010310a8b2e9f2decf2f045c7c 1 parent 69b4bdb
@alexksikes authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 app/lib.py
View
8 app/lib.py
@@ -1,10 +1,10 @@
# Author: Alex Ksikes
-import re, urllib, pycurl, cStringIO, string
+import re, urllib, pycurl, cStringIO, string, random
from lxml import etree
def yahoo_search(query, start, results):
- appid = 'qw87vZXV34Fv5NbIhOHEleK5iL9RTgripE68mWDbEbry7KtyvUWZ6eyHq3uUU_HTFMg-'
+ appid = 'your app id'
url = 'http://search.yahooapis.com/WebSearchService/V1/webSearch?appid=%s&query=%s&results=%s&start=%s' % \
(appid, urllib.quote(query), results, start)
xml = parse_xml(dnl(url))
@@ -52,6 +52,10 @@ def capitalize_first(str):
str = ''
return ' '.join(map(string.capitalize, str.lower().split()))
+def get_pub_id():
+ pub_ids = dict(alex = 'pub-1431948349807205', philipp = 'pub-4135663670627621')
+ return pub_ids.values()[random.randint(0,1)]
+
# we may want to use this in order to preserve some of html of wikipedia
def strip_tags(html, ignore_tags='<b>|<i>|&#?\w+;'):
skip_p = re.compile(ignore_tags, re.I)
Please sign in to comment.
Something went wrong with that request. Please try again.