def api_collection_source_representation_csv(collection_id): user_mc = user_mediacloud_client() info = user_mc.tag(collection_id) source_representation = apicache.collection_source_representation(user_mediacloud_key(), collection_id) props = ['media_id', 'media_name', 'media_url', 'stories', 'sample_size', 'story_pct'] filename = info['label'] + "-source sentence counts.csv" return csv.stream_response(source_representation, props, filename)
def api_collection_source_representation(collection_id): source_representation = apicache.collection_source_representation( user_mediacloud_key(), collection_id, sample_size=500, fq="publish_date:[NOW-90DAY TO NOW]") return jsonify({'sources': source_representation})
def api_collection_source_representation_csv(collection_id): user_mc = user_mediacloud_client() info = user_mc.tag(collection_id) source_representation = apicache.collection_source_representation(user_mediacloud_key(), collection_id, sample_size=500, fq="publish_date:[NOW-90DAY TO NOW]") props = ['media_id', 'media_name', 'media_url', 'stories', 'sample_size', 'story_pct'] filename = info['label'] + "-source sentence counts.csv" return csv.stream_response(source_representation, props, filename)
def api_collection_source_representation(collection_id): source_representation = apicache.collection_source_representation( user_mediacloud_key(), collection_id) return jsonify({'sources': source_representation})
def api_collection_source_representation(collection_id): source_representation = apicache.collection_source_representation(user_mediacloud_key(), collection_id) return jsonify({'sources': source_representation})