how to get Wikipedia's event(portal events) data using wikipedia api in .net? - api

I have to get events from Wikipedia. suppose I type Brazilian Grand Prix, output should not be what Brazilian Grand Prix is but it should be where it is being held in upcoming days/weeks.I have to implement it on asp.net web application. User input should be only event name and he will get output in xml/json format. Please tell me if anyone know how to do this?
we can see all events here: http://en.wikipedia.org/wiki/Portal:Current_events
But I don't know how to get it programmatically.

I'm not completely sure, but it seems to me that you want to get a list of pages whose names are in the form Portal:Current events/2012 November 25, depending on what exactly do you consider “current”. Then search the code for each of those pages for what you want. If you get a match, output the line that matched.
Probably the easiest way to get the code of a page is to use action=raw. Another option is to use the API.

Related

How to fetch results from an offset when the API doesn't support offset (HERE Maps API)

I have a search functionality that gets data from HERE API's Search endpoint. I maintain records of each search's results so I can add metadata that I need for my own purposes and also so I can provide results without always going back to HERE API. The problem I have is with paginating, specifically with providing a starting index when fetching results from HERE. Similar to how Algolia does it, I want to be able to search for a term and begin with the results at a certain index, the offset. HERE API apparently doesn't allow this at all. The closest it comes to such a feature is that it provides the URL for the next search, as described here. This is limited because it doesn't allow me to start the search results at a particular index that I specify. So essentially I want to know if there's a "standard" way of getting such functionality even when it's not provided by the API.
My own solution
The HERE API provides a size parameter that allows specifying the total number of results that I want, so I can specify a larger size than I need, and basically use code to start the results from my desired index. But this feels a bit hacky, and I wonder if there's a better/more established way of doing this.
Happy to listen to any ideas! Thanks. :)
Such a kind of an 'offset' for starting the paging after a specific number of results is indeed not supported by the Places API itself.
You have to set up a workaround within your application.

How to use {loc_physical_ms} to get city and ZIP code on your website?

So I have a client that wants to do a Google Ad campaign for certain locations. From what we gathered, you can set up location of interest and pass on a parameter {loc_physical_ms} that can be used to get some details based on that ID. My question is, how do I access that info? Is it by using an API? I did looked at the reference here:
https://developers.google.com/adwords/api/docs/appendix/geotargeting
But it is not explained how I can use that ID on my website to get something like the ZIP code and city of the click. I been looking around, but to no avail. Any suggestion is welcome.
Thanks in advance!
Ok, found the solution. So for anyone that may come across this, that link I have above provides you with a CSV with the latest Geo Target list. I was under the impression that Google would provide an API for us to use, but that is not the case here. You will have to import that data into your database, and then use it from there. So once you have that data in your database, you can then just make a query that will use the ID from the parameter {loc_physical_ms} from the database as reference for your query.

Get cryptocurrency twitter, website, and markets from coinmarketcap.com api

I am trying to get the twitter name, website, and markets for any cryptocurrency listed on coinmarketcap.
For example:
https://coinmarketcap.com/currencies/bitcoin shows all of the data that I need but how would I parse the data listed on that page to get the twitter name and website associated with bitcoin?
Don't try to parse the data on that page if you are trying to use it in an application. If you are doing it for a one time data collection then maybe that is OK. There is absolutely no guarantee that the format will remain consistent or that the information will even be there tomorrow.
You should try to find an API that gives you the information that you are looking for. An API is a contract that is expected to be honored and therefore is reliable. A quick look at CoinMarketCap's API doesn't appear to have the info you are looking for but maybe another one exists that does.
If you were to parse the HTML you could write a regex for the specific thing you are looking for. For example if you want to get the website you could write a regex that would pick up the pattern:
Website
the capture group ([^"]+) is the website in this example. You could do something like that for every element you want to get.

Google Place Autocomplete API returning wrong place id

Since today (or yesterday) the Google Place Autocomplete web service (https://developers.google.com/places/web-service/autocomplete) is returning a wrong place id (place_id). Does anyone know how to get the right place id from the Autocomplete API?
For example, the place id for New York City is ChIJOwg_06VPwokRYv534QaPC8g (according to the Place Details API), but the Autocomplete API returns ChIJOwg_06VPwokRYv534QaPC8iaBilOZXcgWW9yayBDaXR5LCBOZXcgWW9yaywgVmVyZW5pZ2RlIFN0YXRlbg as place_id. The beginning of the string is almost the same, except for the last character of the 'right' place id (g).
Is this a bug or is Google changing their place ids? Unfortunately I can't find anything related to this problem.
Some place ids from the Place Autocomplete API have been altered due to a recent issue: https://code.google.com/p/gmaps-api-issues/issues/detail?id=11107. The longer place ids should be accepted by all Maps APIs (but see the caveat in https://code.google.com/p/gmaps-api-issues/issues/detail?id=11107#c30).
Unfortunately, this will be around for some time. A way to get the "short" place id corresponding to a long one is to issue a Place Details call with the long place id (the returned result will have a short place id).

how to create version one burned down chart using java REST client api

I am trying to get the data to create the burned down chart from version one.
I came to know there is no standard api's for that.
Here i found that by making multiple call's to fetch todo value for a scope of timebox it is possible.
Is there any better way to do it?
and also let me know any good open source libraries(javascrpt/java) to plot such graph
i tried the way shown here but i am not able to make out what value i am getting.
i tried a get request like
"base URL"/rest-1.v1/Data/Timebox?where=State.Code='ACTV'&asof"11-25-2015"&sel=Name,EndDate,State,Workitems.ToDo.#Sum
but could only get present value but not the past ones.
Thanks in advance
You are using the rest-1.v1/Data endpoint. From this endpoint you will get the current state of assets in your VersionOne instance however, there is an attribute "Prior" which contains the previous state of a VersionOne asset (Timebox). The most robust way to access historical data is though the rest-1.v1/Hist endpoint. You can find details about Hist queries here.
Using your query
"base URL"/rest-1.v1/Hist/Timebox?where=State.Code='ACTV'&asof"2015-11-25T17:30:00.00"&sel=Name,EndDate,State,Workitems.ToDo.#Sum
The asof keyword will return the state of that Timebox at that instance in time. Observe the proper format of the date.