API call fails on my webhost - yahoo

I m trying to retrieve data using the Yahoo API
This is the API that I m using to retrieve info
http://ff.search.yahoo.com/gossip?output=fxjson&command=QUERY
This is working on my Local server, but when I m using it in my web app.
The query shows blank result. Can anyone tell me why is so happening. I tried searching it in the YDN forums. But I couldn't find suitable info about it !

The ff.search.yahoo.com server is used for type-ahead search in browsers like Firefox. It's not an API, and I would not recommend developing anything that uses it. (In addition to possible terms of service violations, it may cease working or change at any time.)
As an alternative, you could use Yahoo's YQL service to select from the Search Suggestions search interface.
Here's an example query for the search term "soccer" (which you can try in the YQL console):
select k from yahoo.search.suggestions where command="soccer"
Sample results:
{
"query": {
"count": 10,
"created": "2012-10-21T01:16:15Z",
"lang": "en-US",
"results": {
"s": [
{
"k": "soccernet"
},
{
"k": "soccer games"
},
{
"k": "soccer.com"
},
{
"k": "soccer ball"
},
{
"k": "soccer offices raided"
},
{
"k": "soccer jerseys"
},
{
"k": "soccer shoes"
},
{
"k": "fox soccer channel"
},
{
"k": "world cup soccer"
},
{
"k": "mls soccer"
}
]
}
}
}

Related

Amazon SP-API B2B Price Issues

I am trying to get product pricing and competitive pricing, using the two API calls.
https://github.com/amzn/selling-partner-api-docs/blob/main/references/product-pricing-api/productPricingV0.md#getpricing
https://github.com/amzn/selling-partner-api-docs/blob/main/references/product-pricing-api/productPricingV0.md#getcompetitivepricing
I have everything working for normal B2C pricing, based on the below.
Giving me a response of
{
"payload": [
{
"status": "Success",
"ASIN": "B003X2CREY",
"Product": {
"Identifiers": {
"MarketplaceASIN": {
"MarketplaceId": "A1F83G8C2ARO7P",
"ASIN": "B003X2CREY"
}
},
"Offers": [
{
"BuyingPrice": {
"ListingPrice": {
"CurrencyCode": "GBP",
"Amount": 169.42
},
"LandedPrice": {
"CurrencyCode": "GBP",
"Amount": 169.42
},
"Shipping": {
"CurrencyCode": "GBP",
"Amount": 0.00
}
},
"RegularPrice": {
"CurrencyCode": "GBP",
"Amount": 169.42
},
"FulfillmentChannel": "MERCHANT",
"ItemCondition": "New",
"ItemSubCondition": "New",
"SellerSKU": "LV429407"
}
]
}
}
]
}
If I duplicate this exact same call and now add the OfferType: B2B it now gives off a unauthorized error.
If anyone has idea that would be much appreciated.
I have spoken to Amazon Support and they have responded with the following.
The CustomerType value of "Customer" is not launched for all sellers,
only certain sellers are part of the beta testing, and other sellers
will get the access denied issue.
I guess not all of the SP-API are fully developed at present.

Incorrectly selected data in the query

Only articles that contain the EmailMarketing tag are needed.
I'm probably doing the wrong search on the tag, since it's an array of values, not a single object, but I don't know how to do it right, I'm just learning graphql. Any help would be appreciated
query:
query {
enArticles {
title
previewText
tags(where: {name: "EmailMarketing"}){
name
}
}
}
result:
{
"data": {
"enArticles": [
{
"title": "title1",
"previewText": "previewText1",
"tags": [
{
"name": "EmailMarketing"
},
{
"name": "Personalization"
},
{
"name": "Advertising_campaign"
}
]
},
{
"title": "title2",
"previewText": "previewText2",
"tags": [
{
"name": "Marketing_strategy"
},
{
"name": "Marketing"
},
{
"name": "Marketing_campaign"
}
]
},
{
"title": "article 12",
"previewText": "article12",
"tags": []
}
]
}
}
I believe you first need to have coded an equality operator within your GraphQL schema. There's a good explanation of that here.
Once you add an equality operator - say, for example _eq - you can use it something like this:
query {
enArticles {
title
previewText
tags(where: {name: {_eq: "EmailMarketing"}}){
name
}
}
}
Specifically, you would need to create a filter and resolver.
The example here may help.

graphQL filter array containing ALL

I am quite new to graphQL, and after searching the whole afternoon, i didn't found my answer to a relative quite simple problem.
I have two objects in my strapi backend :
"travels": [
{
"id": "1",
"title": "Bolivia: La Paz y Salar de Uyuni",
"travel_types": [
{
"name": "Culturales"
},
{
"name": "Aventura"
},
{
"name": "Ecoturismo"
}
]
},
{
"id": "2",
"title": "Europa clásica 2020",
"travel_types": [
{
"name": "Clasicas"
},
{
"name": "Culturales"
}
]
}
]
I am trying to get a filter where I search for travels containing ALL the user-selected travel_types.
I then wrote a query like that :
query($where: JSON){
travels (where:$where) {
id # Or _id if you are using MongoDB
title
travel_types {name}
}
And the parameter i try to input for testing :
{
"where":{
"travel_types.name_contains": ["Aventura"],
"travel_types.name_contains": ["Clasicas"]
}
}
This should return an empty array, because none of the travels have both Aventura and Clasicas travel-types.
But instead it returns the travel with id=2. It seems that only the second filter is taken.
I searched for a query which would be like Array.every() in javascript, but i wasn't able to find.
Does someone has an idea how to achieve this type of filtering ?
Thank you very much,

How do I know which rule is active or inactive with sonarqube web api?

all.
I use sonarqube webapi /api/rules/show?key=squid:S4087&actives=true to get detailed information about a rule. The result is json format data, which field present the rule is active or inactive. Anyone can help? I want to know if the rule is active or inactive, is there any other way to do this?
Sonarqube version is Version 6.7 (build 33306).
You can use the following:
api/rules/search?rule_key=squid:S4087&f=actives
Result is:
{
"total": 1,
"p": 1,
"ps": 100,
"rules": [
{
"key": "squid:S4087",
"type": "CODE_SMELL"
}
],
"actives": {
"squid:S4087": [
{
"qProfile": "AWWHfPzOrB_d62qUtqCX",
"inherit": "NONE",
"severity": "MINOR",
"params": [],
"createdAt": "2018-08-29T23:00:39+0200"
}
]
},
"qProfiles": {
"AWWHfPzOrB_d62qUtqCX": {
"name": "Sonar way",
"lang": "java",
"langName": "Java"
}
}
}

Why Google Cloud Speech API doesn't transcript the whole audio file?

I'm trying to transcript a short interview audio file with Google Cloud Speech API (asynchronously) but it only transcribes the first half minute of the recording. I had several attempts with recordings longer than one minute and the results were the same. My question is, how can I achieve the full audio transcription for a given file?
You can find one of my use-cases here:
Upload the audio file:
POST https://speech.googleapis.com/v1beta1/speech:asyncrecognize?key={YOUR_API_KEY}
{
"config": {
"encoding": "LINEAR16",
"sampleRate": 16000,
},
"audio": {
"uri": "gs://protean-blend-146812.appspot.com/record__2017_02_02_12_02_17_greg_16000.wav",
}
}
Got the operation number in the response:
{
"name": "8977932499808116064"
}
Make a request with the operation number:
GET https://speech.googleapis.com/v1beta1/operations/8977932499808116064?key={YOUR_API_KEY}
Got the result:
{
"name": "8977932499808116064",
"metadata": {
"#type": "type.googleapis.com/google.cloud.speech.v1beta1.AsyncRecognizeMetadata",
"progressPercent": 100,
"startTime": "2017-02-02T11:21:41.346784Z",
"lastUpdateTime": "2017-02-02T11:23:03.150491Z"
},
"done": true,
"response": {
"#type": "type.googleapis.com/google.cloud.speech.v1beta1.AsyncRecognizeResponse",
"results": [
{
"alternatives": [
{
"transcript": "McGregor you have any stories about being lost that you have all the good advice well let me know in the Golden Triangle drug trafficking across the border",
"confidence": 0.8535113
}
]
},
{
"alternatives": [
{
"transcript": "we came across this Village very very poor Village People and some of the people there were really unfriendly they just started throwing rocks and my friend and we couldn't talk so we backed away went back quickly up the hill",
"confidence": 0.9027881
}
]
},
{
"alternatives": [
{
"transcript": "and we are wondering you know where to go and luckily I can see in the distance there in one tree",
"confidence": 0.8931573
}
]
}
]
}
}
The links, where I made the requests (at 'Try it!' section):
Upload: https://cloud.google.com/speech/reference/rest/v1beta1/speech/asyncrecognize
Operation response: https://cloud.google.com/speech/reference/rest/v1beta1/operations/get

Resources