Ejemplo n.º 1
0
import logging
import re
import json


#sources = {
#    'NasaImageExchange': NasaImageExchange,
#    'ArtstorSearch': ArtstorSearch,
#    'Flickr': FlickrSearch,
#}

source_classes = [
    #NasaImageExchange, TODO: ignoring completely
    #ArtstorSearch, TODO: this should be implemented through unitedsearch
    #FlickrSearch, TODO: Maybe implement later
] + aggregate.federatedSearchSources()


def sidebar_api_raw(request, query, cached_only=False):
    print "sidebar_api_raw-----------"
    print query

    sources = dict(
        (lambda s: (s.get_source_id(), s))(c()) for c in source_classes
    )

    if not request.user.is_authenticated():
        return dict(html="Please log in to see additional content.", hits=0)

    if not query:
        return dict(html='Please specify at least one search criteria to find additional content.', hits=0)
Ejemplo n.º 2
0
import logging
import re
import json

#sources = {
#    'NasaImageExchange': NasaImageExchange,
#    'ArtstorSearch': ArtstorSearch,
#    'Flickr': FlickrSearch,
#}

source_classes = [
    #NasaImageExchange, TODO: ignoring completely
    ArtstorSearch,
    #FlickrSearch, TODO: Maybe implement later
] + aggregate.federatedSearchSources()


def sidebar_api_raw(request, query, cached_only=False):
    print "sidebar_api_raw-----------"
    print query

    sources = dict(
        (lambda s: (s.get_source_id(), s))(c()) for c in source_classes)

    if not request.user.is_authenticated():
        return dict(html="Please log in to see additional content.", hits=0)

    if not query:
        return dict(
            html=
Ejemplo n.º 3
0
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.template import RequestContext
from django.template.loader import render_to_string
from django.core.urlresolvers import reverse
from rooibos.util import json_view
from datetime import datetime, timedelta
from threading import Thread
from models import HitCount

from rooibos.unitedsearch import aggregate

import logging
import re
import json

source_classes = [] + aggregate.federatedSearchSources() #[
    #NasaImageExchange, TODO: ignoring completely
    #ArtstorSearch, TODO: this should be implemented through unitedsearch
    #FlickrSearch, TODO: Maybe implement later
	

def sidebar_api_raw(request, query, cached_only=False):
    print "sidebar_api_raw-----------"
    print query

    sources = dict(
        (lambda s: (s.get_source_id(), s))(c()) for c in source_classes
    )

    if not request.user.is_authenticated():
        return dict(html="Please log in to see additional content.", hits=0)