I am looking for basically a repository of information regarding stores. Say I have an app, how would I find all the local stores that sell 'cellphones'? I have been using Google search to solve this but no luck. I know this is possible because through the use of Google maps or i-maps, you are able to find stores and public locations near you. I want to be able to find the store Items of a store. So i could for example say in my search in-app, "What stores will be selling PS4?". This will then display the location of all stores who will be selling PS4. I am not looking for code, I'm looking for data where this would be stored, like Data.gov etc...
Edit*
That's what I believed (#Naomi Owens), in regards to the item stock of a store. So since not knowing the stores current Item stock information, a go around would be to find all the stores that would seemingly sell that particular item and then based off assumptions and factual information regarding the release date of 'said item', notify the user that the queried item will be sold at those retailers based off assumptions. I guess you could then use a percentage system based off of 'logical assumption' the likelihood of a store selling that item. Example Walmart would have a higher likelihood (percentage) of selling a PS4 than would Fye (or some other smaller electronic store).
Locating nearby stores selling a particular product should be simple enough using Google API. The stock in these shops is constantly changing however and if such a database existed may not be very accurate. Each shop's stock, orders, customers etc. are located on their own private database which you wont have access to for obvious reasons. Many apps that do this type of thing do so through html scraping or xml parsing rss feeds. Neither of those would work in this case given that most shops do not use rss feeds and the large amount of html scraping that would be required otherwise.
Edit - I doubt that a database exists containing a list of all of a stores assumed stock, since the majority of people are only interested in live information. Sounds like a database that you would have to create yourself or pay someone else to create for you.
Related
I'm making an app where it stores how many minutes a user has studied with my app. My Firestore database starts with a "users" collection, and each user has their own document that is named by their userID generated in Auth.
My question is if I read their userID document, which has many documents in its sub collections, does that count as one read or does it also count the number of documents in the sub collections as well?
Thank You in advance.
The answer here from Torewin is mostly correct, but it missing one important detail. It says:
if you retrieve a document; anywhere, it counts as a read
This is not entirely true. Cached document reads are not billed as reads. This is one important feature of the Firestore client SDKs that helps lower billing costs. If you get a single document using the source option cache (options are "cache" or "server" or "default"), then the cache will be consulted first, and you get the document without billing. The cache is also used for query results when the app is offline.
The same is true for query results. If a document comes from cache for some reason, there is no billing for that read.
I am uncertain what Torewin means by this in comments: "They recommend you make multiple reads instead of 1 big one because you will save money that way". All reads are the same "size" in terms of billing, considering only the cost of the read itself. The size of the document matters only for the cost of internet egress usage, for which there is documentation on pricing.
It's worth noting that documents can't "contain" other documents. Documents are contained in collections or subcollections. These collection just have a "path" that describes where they live. A subcollection can exist without a "parent" document. When a document doesn't exist, but a collection is organized under it, the document ID is shown in italics in the console. When you delete a document using the client API, none of its subcollections are deleted. Deletes are said to be "shallow" in this respect.
If you are referring to is it 1 read to access a Document (in this case your generatedUserID) from FireStore?
I would imagine the answer would be yes.
Any query or read from Firestore only pulls the reference that you are mapping to. For example, if you grab the 3rd document in your User -> userID -> 3rd document, only the 3rd document will be returned. None of the other documents in that collection or any of the collections besides the userID.
Does that answer your question or are you asking something completely different?
For reference: https://firebase.google.com/docs/firestore/pricing#operations
Edit: Each individual Document that is pulled from the query will be charged. For example, if you pull the parent collection (with 6 documents in it), you will be charged for all 6 documents. The idea is to only grab the documents you need or use a cursor which let's you resume a long-running query. For example, if you only want the document pertaining to use data on a specific date (if your data is set up like that), you'd only retrieve that specific document and not retrieve all of the documents in the collection for the other days.
A simple way of thinking about it is: if you retrieve a document; anywhere, it counts as a read.
I'm looking to use firebase's realtime database for a few different projects and if I select the 3rd and final subscription option it changes price per month based on usage ( if I'm not mistaken ). I want to make sure that if I choose this 3rd option of payment that it's something my app can provide sufficent funds for each individual user. Is there a way I can check how much the third option would cost based on recent usage or can I find out how much data it's currently using them I can manually compare them?
I am building a game in which I have two API's that help me to show the leaderboard. The first API gives the overall leaderboard, the top 10 users in the game at any time. The second API gives my position in the leaderboard with five users above me and five users below me. I need to show two tabs in the app which give the overall leaderboard and my position in the leaderboard. I have created a User model in my Core data stack that is used to sync data from the API's. I need to somehow differentiate that which API sent the data that was saved in my persistent store. I would be using this information to delete the previous data that I fetched from the API's so that there is no junk data in my app. Is it ok to save a field in my user model that gives information about which API was used to sync that data? Is there a better way to achieve this?
An interesting question you didn't ask was 'should I have a unique identifier for users and have only a single representation of the user in the app at any one time' - this is actually a key piece of information...
If you're downloading the 2 different 'types' of data separately and potentially at very different times then you should have multiple representations of any one user in your app, because they could have very different scores at the time of the request/response. It's also appropriate to store a 'flag' indicating the purpose of the data in the system. Note that this isn't the API that the data came from, it's what the data means to the app - what it's used for. In reality, depending on the API design, that might be the same thing, but it's an important conceptual difference.
I have a strage requirement from a client, he needs to display a ramdom selection (100 - 200 items from mixed categories) of products for sale on & shipped by Amazon but ordered by price. The idea is to allow people find gift ideas based a user input price point.
I have been looking through the API docs but cannot see an obvious way to find search by price, I am thinking of writing a script to "copy" large parts of the amazon product catalogue into a local database & have it update every few weeks, then use this for user searches, but this does not feel right / their must be a better way.
Has anyone any experience with this type of problem? Thanks!
You would want to use the Amazon Product Advertising API. Using this API you would want to perform a SearchIndex-ItemSearch query. Possible parameters to ItemSearch are available on the API Docs here
You can see in the docs that you cannot query by MinimumPrice and MaximumPrice on SearchIndex: All. However, if you search specific indexes, it allows you to do a price related search.
I would guess that you can agree with your client which categories should the items be from. Then you can just query them one by one.
Amazon's database changes very often. Hence, caching data for a week without updating may not be desirable.
I'm have application that allows users to store food diary entries of approximately 140 characters in length. I am looking for a solution that will allow me to tie content modules (think tips for healthy eating) to the user's diary entries based on keywords in the entry similar to what Google does with adwords. Are there any out-of-the-box solutions that can do that in Rails?
Here are the specific requirements:
User logs food diary entry
In the user's food diary, if there's a specific tip that matches a keyword for the entry, then the tip is displayed next to the entry
Tips would be defined through an admin tool where the admin specifies the tip content and keywords that would make it appear in the diary
Trying to figure out a) if there's a pre-build solution I could use for something like this or b) what the best approach would be for performance since the users's food diary might have 20 entries per page, and each entry would have to be evaluated to see if there are any corresponding tips that match entry keywords.
For designing a home-grown solution, one idea I had was to make the tip associations when a new food entry is stored like this:
user adds a food entry
after_save a callback method breaks apart the entry into keywords and searches the tips model for matches
if there's a match, it's stored in an association table when new entries are created rather then when the user's food diary is rendered in the web page.
There's a performance hit on storing new entries, but it might allow the user's diary to load faster then doing all those look-ups when the diary is rendered.
Does that make sense, or is there a better way? better yet, are there tools that can accomplish what I'm trying to do?
Thanks!
This is not an AdWords API question, but I'll take a shot:
I would move the association table building into an offline task / cronjob. That would take care of the performance overhead when creating new entries, and users would be generally okay with a message like "Tips are being generated, please be patient" if they happen to view the topic too soon.
I'm not aware of any existing solutions, but this sounds like a hashtag system to me. Basically you have two lists (food dairy entries, tips), you want to assign hashtags to both lists and then pair entries with same hashtags. Googling for a hashtag system / library might be a good starting point.
Cheers,
Anash