reading RSS returns different response on localhost - linq

im trying to parse an rss feed on localhost, and it brings back the right results, but when i try to do that from another (preproduction server) and live, it returns a list of comments made by users on the hydrapinion website which is completely unrelated, have i been spoofed? how can i debug this? its just an rss feed and a simple LINQ code!
string bingurl = "http://www.bing.com/search?form=QBRE&filt=rf&qs=n&format=rss&count=10&q=+environment+(site:www.australianit.news.com.au)";
XDocument doc = XDocument.Load(bingurl);
IEnumerable<XElement> items = (from i in doc.Descendants("item")
orderby DateTime.Parse(i.Element("pubDate").Value) descending
select i).Take(10);
rpData.DataSource = items;
rpData.DataBind();
i tried a different combination, and i get no results at all! do u think the server settings have antyhing to do with retrieving rss results?

i found some decent guide for bing search, but as it turned out, bing doesnt bring decent resuls! and it appears to me it changes the results set according to where ur calling it from, i tried adding "loc:" to the rss, when called from code it returned different results than when called on bing website itself, i dont know the algorithm they are using but it is getting more obvious
the guide is here:
http://help.live.com/help.aspx?mkt=en-AU&project=a

Related

Using Pinterest Marketing api to fetch all entities?

Is there an edge that would allow fetching all the campaigns, adgroups, etc., of a given advertiser? In researching this I see these:
GET /ads/v3/campaigns/{campaign}/
GET /ads/v3/adgroups/{adgroup}/
...
which return only single entities. I also found that there is an async report that returns entities in batch:
advertisers/<advertiser ID>/entities/batch/
Is this the best way to accomplish this? If so, the doc says it only supports campaigns right now, is that still the case?
Thanks
Sorry to waste your time folks, I've since found more and better doc and discovered that there is this:
/ads/v3/advertisers/{advertiser}/campaigns/
Here is a link to the doc for your own reference:
https://developers.pinterest.com/docs/redoc/#operation/ads_v3_get_advertiser_campaigns_handler_GET

Umbraco 8 - Get Children Of Node Using ContentAtXPath() Method

I've been refactoring an existing Umbraco project to use more performant querying when getting back document data as everything was previously being returned using LINQ. I have been using a combination of Umbraco's querying via XPaths and Examine.
I am currently stumped on trying to get child documents using the Umbraco.ContentAtXPath() method. What I would like to do is get child document based on a path I parse to the method. This is what I have currently:
IEnumerable<IPublishedContent> umbracoPages = Umbraco.ContentAtXPath("//* [#isDoc]/descendant::/About [#isDoc]");
Running this returns a "Object reference not set to an instance of an object." error and unable to see exactly where I'm going wrong (new to this form of querying in Umbraco).
Ideally, I'd like to enhance the querying to also carry out sorting using the non-LINQ approach, as demonstrated here.
Up until Umbraco 8, content was cached in an XML file, which made XPath perfect for querying content efficiently. In v8, however, the so called "NuCache" is not file based nor XML based, so the XPath query support is only there for ... well... Old times sake, I guess? Either way it's probably not going to be super efficient and (I'd advise) not something to "aim for". That said I of course don't know what you are changing from (Linq can be a lot of things) :-/
It certainly depends on how big your dataset is.
As Umbraco has moved away from the XML backed cache, you should look into Linq queries against your content models. Make sure you use ModelsBuilder to generate the models.
On a small dataset Linq will be much quicker than examine. On a large dataset Examine/Lucene will be much more steady on performance.
Querying NuCache is pretty fast in Umbraco 8, only beaten by an Examine search.
Assuming you're using Models Builder, and your About page is a child of Home page, you could use:
var homePage = (HomePage) Model.Root();
var aboutPage = homePage?.Children<AboutPage>().FirstOrDefault();
var umbracoPages = aboutPage.Children();
Where HomePage is your home page Document Type Alias and AboutPage is your About page Document Type alias.

Youtube Api no result issue

I'm trying to use Youtube Api V3 to get documentaries videos, unfortunately I can't get any results for many searched keys.
Is there any advanced configuration I can use to get more results or is there any alternative API(s) ?
this is my query
https://www.googleapis.com/youtube/v3/search?part=snippet&q=alien&type=video&videoCategoryId=35
First and foremost make sure you have an API_KEY. Follow link for details, then go to developer console to get one.
Then your request URL should look like this.
var API_KEY = "your api key";
var channelID = "The channel id u wan to pull";
var result = 30 // Limit the number of videos
`https://www.googleapis.com/youtube/v3/search?key=${API_KEY}&channelId=${channelID}&part=snippet,id&order=date&maxResults=${result}`
With an API key, I also pulled 0 results for 'alien' in the Documentary category. Perhaps there aren't any.

How do I get a count of the Shopify products in a collection using the Ruby API

I want to get the count of products in each collection in the shop as part of a Shopify App that I'm building.
I know that for a single collection Product.all(params: {collection_id: 29238895}).count will show me the count in the shopify console, but I'm not certain about how it is implemented.
The API document describes a call that counts all products that belong to a certain collection GET /admin/products/count.json?collection_id=841564295 but I have been unable to get a ruby expression that runs this.
Is there a more complete document on the Ruby API?
If you want to know exactly what is going on with the API, may I suggest the simple command: bundle open shopify_api
That will load the entire API into your text editor, allowing to quickly determine the answer to your question. The /lib/resources directory is especially rich, but do not forget to check the base class as well. In fact, I think the count option is declared right in the base itself. Nothing beats a few minutes of examining the code.

Getting Location of Tweets found with Twitter Search API

Whenever I search for tweets using the geocode option, the returned tweets have "null" as their geo property. They are definitely coming from the right place because the location property has a name which is in the correct area, however I want to know what the coordinates of the tweet are so I can place on on a map (specifically Windows Phone).
I've tried a really hacky solution of searching for the location using the geo api, but this seems a really awkward way of doing it and often returns bad results (I want results from Oxford, UK but often the geo search return Oxford, IN for example).
Looking around, it seems Twitter's geolocation is currently broken, but I really need this to work for a presentation on Thursday demonstrating an app we built in a group, and it would really suck if our main feature didn't work.
Twitter's search API is broken. It will not return some information which is available through the regular API.
Once you have found a Tweet, you can try looking it up directly using statuses/show
For example, calling one of my tweets:
https://api.twitter.com/1/statuses/show.xml?id=202471009973051393&include_entities=true
gives
<geo>
<georss:point>51.52505194 -0.132582</georss:point>
</geo>
<coordinates>
<georss:point>51.52505194 -0.132582</georss:point>
</coordinates>

Resources