Where can I find a hook to customize the search via Shopware App? - shopware

I am prototyping a Shopware App right now, where I want to extend the search with our search API. We already have a working plugin in the store for that.
I found those two references for hooks:
https://developer.shopware.com/docs/resources/references/app-reference/webhook-events-reference
https://developer.shopware.com/docs/resources/references/app-reference/script-reference/script-hooks-reference
Seems like there is no webhook for the search at all and just a script-hook for a finished search. In the plugin, we could just extend the ProductSearchRoute and be completely flexible.
Are search extension not planned right now?
Cheers,
Tobias

I assume you want to alter the criteria for fetching the products. As of today this is not yet possible with non-self-hosted apps. You could use the app scripts to enrich or replace the contents of an already loaded page as you already mentioned. Obviously that comes with some drawbacks regarding performance. The capabilities of apps are being enhanced continuously though so there's chance search manipulation might become possible rather soon.

Related

Is it possible to use multiple parameters in SonarQube search API?

After some time spent scouring google and looking through the Sonar Qube API documentation, along with trying a few permutations on common patterns, I have arrived to the point where I am wondering if it is even possible to use multiple parameters when doing an issue search in SonarQube's API.
Purpose of search is to populate a team radiator with issue data from Sonarqube. This data will be combined with build data from other sources (Or else I would just link to the SonarQube display page)
current configured URL to api is:
https://sonarqubesitehere.com/api/issues/search?=projectKeys=com.projectnamehere
(This is dummy code with names changed to protect the innocent)
I would like to be able to add a second parameter to this search that allows me to receive only major (or minor) issues that belong to the specific project I specify. the search term for that search is /search?severities=MAJOR
Anyone wrangled with this particular problem?
Please check the WS API on sonarqube.com or your own instance like: https://your-sonarqube.com/web_api/api/issues/search.
Here's an example of api/issues/search with several parameters
Hummmm... Provided that you read the Web API documentation for /issues/search, and that you know how to correctly write a URL that uses parameters, then it's quite easy to find that the solution is the following:
https://<your_server>/api/issues/search?projectKeys=project1Key,project2Key&severities=MINOR,MAJOR
Live example on SonarQube.com: https://sonarqube.com/api/issues/search?projectKeys=clang,git&severities=BLOCKER

Nest Protect - Pathlight History

My Nest Protect has the ability to automatically turn on the pathlight when it senses motion. This is a useful feature and somewhere it is actually being recorded when it turns on, because I can see the history in my Nest App for iOS.
I'm wondering if Nest has any plans to make those timestamps accessible via the API? Or is there already a way to find that information that is not part of the API? I'd like to export in a text format.
Thank you,
Ryan
The historical info isn't available but you can get the pathlight status over the api. You can even get the specific color.

Apps Script vs Chrome Extension: Writing an alternative spellchecker to Google Docs

Say, I want to develop an alternative spellcheck module to google docs.
This means that I have to get corrections from my backend, and color the misspelled text's background, and do a small popup bubble when user hovers over it, where I'd display the correction. (please mind that spellcheck is not the actual goal of my project, but it does address my problems in a more simplified way)
What are my options? Any ideas how to do this?
Few possible solutions I came up with:
Chrome extension vs Apps script
Chrome extension
pros: user has to grant permissions once, can freely traverse and append anything to dom via content script
cons: is a "hacky" way, if google changes classnames or js source, it would stop working, and also, reverse engineering google docs's editor engine is impossible
Apps script
pros: supported by google: if it works, I dont need to be afraid of docs updates
cons: it seems to me that I can't just fiddle with the dom (because of Caja compiler), has very limited support (if any) for custom highlighting or hover functionality.
As I see it, neither of these are perfect solutions for this project. What do you think? Any suggestions are very welcomed.
I know this is an old question, but I have recently gotten into the same problem, and believe I have a solution. So for future Googler's I will post my answer here.
My solution was to create a Chrome Extension and understand how the Google Docs DOM's are structures to interact with it.
You can find my code to work with the Google Doc DOM's here
In Apps Script you can't "fiddle" with the DOM and you won't be able to implement hover functionality. Also, a lame Highlighting would involve changing the current document itself (which would go to revision history, undo queue, etc)
Therefore, your only altertive is the Chrome Extension. But I agree with you on the cons. It is a super hard task that could break at any minute without notice.

google image search: search similar images

I want to write a mobile app which takes a picture and searches google images for similar pictures and then displays the results.
However, with google image search I can only search for text strings, and with the search API it seems there's no possibility to search for similar pictures; this feature seems to be available only through the web interface.
Any idea how I can solve this problem?
thanks,
Christoph
There is a way you can do this now, but its not officially supported, and there are probably some restrictions on the number of queries you can perform. Update
http://images.google.com/searchbyimage?hl=en&biw=1060&bih=766&gbv=2&site=search&image_url={{URL To your image}}&sa=X&ei=H6RaTtb5JcTeiALlmPi2CQ&ved=0CDsQ9Q8
There is also a google image search API, which is being officially deprecated, but it will work for now.
http://code.google.com/apis/imagesearch/
The Google Vision API.
https://cloud.google.com/vision/
This is very simple and easy and powerful.
I had done something like that recently for a mobile app, this is the code for it, it uses google search by image feature, and returns the "best guess" or the whole page
you could use that and modify it to do what you want, but once you get the best guess of the image you could search for any image with that title, etc
https://github.com/hbattat/search-by-image
I don't think it's possible. If you click the link to find similar images from the images result page you get a link with the original query included:
google.com/images?q=ORIGINAL_QUERY&imgtype=i_similar&sa=...
If you remove that GET param manually, the search does not work, it only shows the images search form.
I dont think it is possible to find similar images with google if you do not know what's on it.
I was looking for an answer to this some time ago, and found tineye. You have to pay for it, though. Currently (Jan 2012) USD300 for 5K searches, USD1.5K for 30K searches...
SerpAPI enables to search through Google Images and returns a clean JSON.
URL example:
https://serpapi.com/search.json?q=Apple&tbm=isch&ijn=0
Documentation:
https://serpapi.com/images-results
This service is integrated with most of the programming languages: python, php, java, golang, nodejs...
Google limit the number of search per day. but this service provides unlimited searches...

Hosting Google Apps UI in my app

I'm investigating the possibility of re-using Google Apps/Docs in a local hybrid desktop/browser application.
I've been going through the Google documentation on manipulating docs, eg. the Spreadsheet. I can't seem to find any info on actually hosting the UI. Is this possible, or does it require some form of permission from Google?
You want to basically embed an browser control in your application pointed at the URL of a Google Apps doc? You could use the Google Document List API to retrieve the documents for a user, then use the URLs of those documents in your embedded browser control.
You don't need Google's permission to do that; you're writing a browser with some extra smarts built in.
What do you mean by "hosting the UI?" These apps are HTML/CSS/JavaScript. Are you thinking about embedding them in AIR or Titanium, or in some kind of web control in another app?
i briefly looked into doing this, and figured if i really wanted to i could just load the gdocs page content dynamically, and use javascript to strip away the superflous elements like header and footer. but instead i'll probably just use an OS alternate because they have come a long way and I want rich hooks.

Resources