Permalink
Browse files

remove Prismatic API. Close issue #69

  • Loading branch information...
1 parent 94206ac commit c203f69b1aed051f81841a1cd790c2f08600fbc8 @harishvc committed Dec 24, 2015
Showing with 2 additions and 56 deletions.
  1. +2 −15 DBQueries.py
  2. +0 −9 RunFlask.py
  3. +0 −32 static/js/custom.js
View
@@ -27,7 +27,7 @@
connection = MongoClient(MONGO_URL)
db = connection.githublive.pushevent
else:
- MONGO_URL = os.environ['connectURLReaddev']
+ MONGO_URL = os.environ['connectURLRead']
connection = MongoClient(MONGO_URL)
db = connection.githubdev.pushevent
@@ -88,10 +88,7 @@ def ProcessQuery(query,offset, per_page):
elif (query.startswith("repository")):
repoName = query.replace('repository ', '')
#show interesting topics
- response2 = "<input type=\"hidden\" name=\"qvalue\" value=" + repoName + "></input>\
- <input type=\"hidden\" name=\"qtype\" value=\"full_name\"></input>\
- <p><span id=\"trendingtopics\"></span><p><div id=\"wrapperfindtrendingtopics\"> \
- <a href=\"javascript:void();\" id=\"findtrendingtopics\">Find interesting topics</a></div></p>"
+ response2 = ""
return (0,"",ProcessRepositories(repoName),response2)
elif (query.startswith("organization")):
return Search(bleach.clean(query.replace('organization ', '').strip()),"organization",offset, per_page)
@@ -345,18 +342,8 @@ def Search(query,type,offset, per_page):
sh = "<p class=\"tpadding text-success\">Repository matches (processing time " + str(MyMoment.HTM(QST,"")).strip() +")</p>"
elif (type == "organization"):
sh = "<p class=\"tpadding text-success\">" + "Repositories inside organization " + query + " (processing time " + str(MyMoment.HTM(QST,"")).strip() +")</p>"
- #Link to find trending topics for organization
- response2 = "<input type=\"hidden\" name=\"qvalue\" value=" + query + "></input>\
- <input type=\"hidden\" name=\"qtype\" value=" + type + "></input>\
- <p><span id=\"trendingtopics\"></span><p><div id=\"wrapperfindtrendingtopics\"> \
- <a href=\"javascript:void();\" id=\"findtrendingtopics\">Find interesting topics</a></div></p>"
elif (type == "contributor"):
sh = "<p class=\"tpadding text-success\">" + "Repositories <strong>" + actorname + "</strong> has contributed to (processing time " + str(MyMoment.HTM(QST,"")).strip() +")</p>"
- #Link to find trending topics for contributor
- response2 = "<input type=\"hidden\" name=\"qvalue\" value=" + query + "></input>\
- <input type=\"hidden\" name=\"qtype\" value=\"actoremail\"></input>\
- <p><span id=\"trendingtopics\"></span><p><div id=\"wrapperfindtrendingtopics\"> \
- <a href=\"javascript:void();\" id=\"findtrendingtopics\">Find interesting topics</a></div></p>"
elif (type == "language"):
sh = "<p class=\"tpadding text-success\">Repositories written in " + query + " (processing time " + str(MyMoment.HTM(QST,"")).strip() +")</p>"
return ( total, sh , "<ul class=\"list-group\">" + output + "</ul>", response2)
View
@@ -27,7 +27,6 @@
#Local modules
import Suggestions
import DBQueries
-import GetPrismatic
#Global variables
NORESULT="<h2 class=\"searchstatus text-danger\">You've got me stumped!</h2>" #No result
@@ -116,14 +115,6 @@ def listlanguages():
Languages = DBQueries.LanguageBreakdown(reponame)
return jsonify(languages=Languages)
-@app.route('/_findtrendingtopics')
-def findtrendingtopics():
- qvalue = bleach.clean(request.args['qvalue']).strip()
- qtype = bleach.clean(request.args['qtype']).strip()
- TT = GetPrismatic.GetInterestTopics(qtype,qvalue)
- return jsonify(trendingtopics=TT)
-
-
def get_css_framework():
return 'bootstrap3'
View
@@ -65,38 +65,6 @@ $(document).ready(function() {
return false;
});
- //Find trending topics on demand
- $('a#findtrendingtopics').bind('click', function() {
- ga('send', {
- 'hitType': 'event', // Required.
- 'eventCategory': 'trendingtopics', // Required.
- 'eventAction': $('input[name="reponame"]').val() // Required.
- });
- $("#wrapperfindtrendingtopics").empty();
- $("#wrapperfindtrendingtopics").html("finding interesting topics just for you <i class=\"fa fa-spinner fa-spin fa-1x\"></i>");
- var d2 = $.ajax({
- url : '/_findtrendingtopics',
- dataType : 'json',
- timeout : (60000),
- data : {
- qvalue : $('input[name="qvalue"]').val(),qtype : $('input[name="qtype"]').val()
- },
- success : function(data) {
- $("#trendingtopics").html(data.trendingtopics);
- $("#wrapperfindtrendingtopics").empty();
- },
- error : function(objAJAXRequest, strError) {
- $("#trendingtopics").html("<span class=\"text-danger\">Query taking too long: Please try again latter</span>");
- $("#wrapperfindtrendingtopics").empty();
- }
- });
- $.when( d2 ).done(function(){
- $('a.trendingtopics').bind('click',cleanup);
- });
- return false;
- });
-
-
//Automatically display Horizontal Bar Charts
if ($('#listlanguages').length > 0) {

0 comments on commit c203f69

Please sign in to comment.