some of the countries do not seem to be supported? - amadeus

I am trying to understand if I can use Amadeus' API to work with airports and flights in France.
I am using amadeus-node.
This returns 0 result when I add the countryCode (ie. result.data is empty)
const airports = await amadeus.referenceData.locations.get({
keyword: keyword,
countryCode: "FR", // once added, results are gone
subType: "AIRPORT",
});
When I remove the country code, it works fine and returns results from the US, Spain and Germany for example.
This other request returns only airports in Spain, while there are in Southern France (eg. MPL)
const airports = await amadeus.referenceData.locations.airports.get({
// next to Montpellier's airport https://goo.gl/maps/XfWBtsu6ZeF9SoDNA
longitude: 3.93,
latitude: 43.58,
});
Did I miss something in the documentation? Is this available for France? Thanks for your help!

Well I think this post from StackOverflow actually answers my question.
It's because not all data is available outside of production. I will most probably get the results I expect once I use the prod environment!

Related

Amadeus flight-offers search GET API won't return flights for AA

I'm learning to use the Amadeus API...
I'm able to search flights using "flight-offers-search", but as the title states, if I restrict results to American Airlines (AA), it returns nothing.
There absolutely are AA flights from DFW on the specified day (I'm on one), so not sure why it would fail.
So far I am unable to return ANY flights on ANY day, if "includedAirlineCodes=AA" is specified.
What is special about American Airlines? What am I missing?
url <- "https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode=DFW&destinationLocationCode=SAN&departureDate=2021-09-03&travelClass=ECONOMY&adults=1&max=5&currencyCode=USD&includedAirlineCodes=AA"
Content from American Airlines is not included in the Self-Service APIs as described in the API overview.

ITunes lookup api doesn't work with language or country code?

url = "https://itunes.apple.com/lookup?id=1510853708
This only returns English results. I want to add a language or country code for China, but none of these worked:
url = "https://itunes.apple.com/lookup?id=1510853708&country=cn
url = "https://itunes.apple.com/lookup?id=1510853708&l=zh
It returned 0 results. I changed id to bundleId, but is the same.
However, search api worked with country=cn. So why doesn't lookup api doesn't work?
try this "https://itunes.apple.com/cn/lookup?id=",
and confirmed that your app sales areas contains China mainland.

Prepend or append to values obtained from Knex js SQL queries

I have a simple people table which has two columns id and name.
I can query all the names along with the id as follows
const persons = await knex('people').select('id','name');
I want to add Dr. in front of all the names.
For example
{id:1, name: 'Tom'}
should return
{id:1, name: 'Dr. Tom'}
How do I do this in knex js ?
I believe you could easily do it in memory using JS map, but apparently you want to do it on db level.
Basically, you need the following query:
select CONCAT('Dr. ', people.name) as 'name', people.id as 'id' from people;
(Tested in w3schools online fiddler)
So, effectively we could try the following (basing on Identifier Syntax from http://knexjs.org/):
knex({ people: 'people' })
.select({
id: 'people.id',
name: 'CONCAT("Dr. ", people.name)'
})
But I'm not sure if knex will substitute it properly.
The problem is, however, that CONCAT is not supported by all SQL dialects, as far as I am concerned.

Google places autocomplete suggestion without country name

I am looking for a possibility to get suggestions without country name.
I have the following js code:
... var autocomplete_pickup = new google.maps.places.Autocomplete(pickup_field, {
types: ["address"], componentRestrictions: {country: "de"}
}); ...
The result is e.g.
Bahnhofstrasse 4, Hamburg, Deutschland
Now I want to have for that example only
Bahnhofstrasse 4, Hamburg
I have limited the countries only to Germany and therefore is not necessary to show the country name.
Do you have an idea?
Thanks.
Heinz-Peter
For resolve it, just add this query param &region=de into your script path
It seems like this:
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=[API-KEY]&libraries=places&region=de"></script>
It helped me.

How to get professions on world of warcraft vanilla's addon?

I'm creating an AddOn for a private server of World of Warcraft 1.12.1/Classic/Vanilla and I need to check the user's professions.
The information I got was the APIs GetProfessions() and GetProfessionInfo() but I can't find out how to use them.
I wanna have a variable for each profession.
It's something like this:
prof1, prof2, archaeology, fishing, cooking, firstAid = GetProfessions()
Profession1 = GetProfessionInfo(prof1)
Profession2 = GetProfessionInfo(prof2)
Profession3 = GetProfessionInfo(archaeology)
Profession4 = GetProfessionInfo(fishing)
Profession5 = GetProfessionInfo(cooking)
Profession6 = GetProfessionInfo(firstAid)
Quick glance shows there are no special tradeskill functions in API in 1.12.1. AFAIR professions were just regular entries in the spellbook back then. As such you can iterate over spellbook with GetSpellName and check that either first return matches name of known profession or second return matches name of a known profession rank.
Additional info on each profession can be retrieved with GetTradeSkillLine, but only when this profession is opened in tradeskill window (i.e. window where you see list of items to craft).
If I'm understanding this correctly, GetProfessions() returns a table. You could always try a different way around the problem, like so:
professions = GetProfessions()
Profession1 = GetProfessionInfo(professions[1])
Profession2 = GetProfessionInfo(professions[2])
Profession3 = GetProfessionInfo(professions[3])
Profession4 = GetProfessionInfo(professions[4])
Profession5 = GetProfessionInfo(professions[5])
Profession6 = GetProfessionInfo(professions[6])
I'm not sure if this will solve your problem, but I figured I could weigh in my opinion. I have never done anything with World of Warcraft.