Exemple #1
0
def add_feed():
    uri = request.data
    from tasks.read_update_feed import check_and_parse_feed

    check_and_parse_feed(uri)
    return_dict = {uri: "created"}
    return json.dumps(return_dict)
Exemple #2
0
def subscribe():
    input_dict = json.loads(request.data)
    from pymongo import MongoClient
    client = MongoClient()
    client = MongoClient('localhost', 27017)

    db = client.feeds
    collection = db.user_feeds_map
    collection.update({'user_name': input_dict['user_name']}, {"$addToSet": {
                      'listOfFeeds.default': input_dict['feed_name']}}, upsert=True)
    from tasks.read_update_feed import check_and_parse_feed
    check_and_parse_feed(input_dict['feed_name'])

    return json.dumps({"value": "created"})