public void FillTopic(TopicItem topicItem)
        {
            String query = topicItem.Query.ToLower().Replace(" ", "_");
            query = TextCleaner.CleanQuery(query);

            if (query.Length > 0)
            {
                try
                {
                    string urlTemplate = "https://www.googleapis.com/freebase/v1/topic/en/{0}?key={1}&{2}";
                    string apiKey = ConfigService.GetConfig(ConfigKeys.GOOGLE_API_KEY, "");
                    string[] domains = new string[] { 
                                         "/common/topic/alias", 
                                         "/common/topic/description", 
                                         "/common/topic/image",
                                         "/common/topic/official_website",
                                         "/common/topic/social_media_presence",
                                         "/influence/influence_node/influenced_by", 
                                         "/people/person/date_of_birth"
                    };
                    string filters = "filter=" + String.Join("&filter=", domains);

                    string url = string.Format(urlTemplate, HttpUtility.UrlEncode(query),apiKey,filters);

                    JSONConnector JSONConnector = new JSONConnector();
                    JObject searchResultsJSONObject = JSONConnector.GetJSONObject(url);

                    new FreebaseTopicParser().Parse(searchResultsJSONObject, topicItem);
                }
                catch (Exception exception)
                {
                    ErrorService.Log("FreebaseTopicService", "FillTopic", topicItem.ToString(), exception);
                }
            }    
        }
        public SearchResultList Search(SearchContext searchContext)
        {
            SearchResultList resultList = new SearchResultList();

            try
            {
                string urlTemplate;
                switch (searchContext.SearchType)
                {
                    case SearchTypeEnum.News:
                        urlTemplate = "http://ajax.googleapis.com/ajax/services/search/news?v={0}&rsz=large&key={1}&q={2}&start={3}";
                        break;

                    case SearchTypeEnum.Web:
                        urlTemplate = "http://ajax.googleapis.com/ajax/services/search/web?v={0}&rsz=large&key={1}&q={2}&start={3}";
                        break;

                    default:
                        return resultList;
                }


                string api = ConfigService.GetConfig(ConfigKeys.GOOGLE_API_KEY, "");
                string query = searchContext.Query;
                int countPerPage = ConfigService.GetConfig(ConfigKeys.THEINTERNETBUZZ_SEARCH_COUNT_PER_PAGE_PER_PROVIDER, 8);
                int page = (searchContext.Page - 1) * countPerPage;

                string url = string.Format(urlTemplate, API_VERSION, api, HttpUtility.UrlEncode(query), page);

                JSONConnector JSONConnector = new JSONConnector();
                JObject searchResultsJSONObject = JSONConnector.GetJSONObject(url);

                new GoogleSearchParser().Parse(searchResultsJSONObject, resultList);
            }
            catch (Exception exception)
            {
                ErrorService.Log("GoogleSearchService", "Search", searchContext.ToString(), exception);
            }

            return resultList;
        }
        public TrendsList GetTrends()
        {
            string urlTemplate;
            switch (trendsType)
            {
                case WhatTheTrendTypeEnum.Current:
                    urlTemplate = "http://api.whatthetrend.com/api/v2/trends.json?api_key={0}";
                    break;

                case WhatTheTrendTypeEnum.MostEdited:
                    urlTemplate = "http://api.whatthetrend.com/api/v2/trends/active.json?api_key={0}";
                    break;

                default:
                    urlTemplate = "http://api.whatthetrend.com/api/v2/trends.json?api_key={0}";
                    break;
            }

            TrendsList trendsList = new TrendsList();

            try
            {
                string api = ConfigService.GetConfig(ConfigKeys.WHATTHETREND_API_KEY, "");
                string url = string.Format(urlTemplate, api);

                JSONConnector JSONConnector = new JSONConnector();
                JObject currentTrendsRootJSONObject = JSONConnector.GetJSONObject(url);
                new WhatTheThrendTrendsParser().Parse(currentTrendsRootJSONObject, trendsList);

            }
            catch (Exception exception)
            {
                ErrorService.Log("WhatTheTrendTrendsService", "GetTrends", urlTemplate, exception);
            }

            return trendsList;
        }