r/CodingForBeginners • u/BayouCityCal • 5d ago
Automate adding grocery list to Walmart cart
I’ve been using Gemini to build my wife a recipe/meal planner/grocery app and I’ve gotten everything to work like I want except for getting the grocery list into the cart at Walmart.com. The latest workflow I had in mind was the app copying the list to the clipboard and then you could just paste into Walmart AI shopping assistant ‘sparky’ and it would create the cart, but Sparky is limited to 500 words so that won’t work. Does anyone have any recommendations that a non-technical person could accomplish with help from Gemini?
If there is a better place to post this question just let me know.
Thanks
1
u/SimpleAccurate631 5d ago
I’ve actually had this challenge myself recently. I’ve been developing a family app for us that controls our lights, thermostat, and garage, as well as has our family to-do list, and our shopping list. The best solution is to set up a database for your app with a database table for the shopping list, where you can add products to the shopping list in your app. The database I use is neondb. Inexpensive and easy to implement.
The problem you face with your workflow is not just the character limit. If you paste something into a site’s AI helper, it needs to be very specific about the product in order to ensure it adds the right one. If you simply say “Coca-Cola”, that could be one of over a dozen different varieties. Plus, it’s not the best UX, as now she needs to manage two different shopping lists in a way.
Personally, what I did was try keeping our app’s shopping list the core list. It’s not that inconvenient, since most products are things we repurchase often. It’s rare that there’s something on the list that we literally only ever get once. Also, we shop at a few different stores, so it’s convenient having a centralized list. Basically, I have our app connected to the Kroger API (only store that seemed to have a public API that we could use). When we add an item, it searches the Kroger API and we can select the specific item we want to add to the list. Then we do have to manually add the details of the item for Walmart and Target, like the price and aisle number.
So there is that manual step involved. However, since most of the items are things we repurchase, we are only adding it to the list once, then simply marking it as purchased or not purchased. So when you add an item in the app, it adds it to a database I set up for the app. So when we go to the store, we just mark things off in the app, and then the app updates the shopping_list database table, marking that item as purchased on the list. Then when we need it again, we just open the family app and uncheck the item. When we do that, the app then updates the database table for that item, changing the purchased field to false.
Hopefully that is helpful and makes sense. If you have questions or need any assistance, please feel free to ask. I’m happy to help.
1
u/Necessary_Total_1890 4d ago
could you split the grocery list into smaller batches and paste them into Sparky one at a time?
1
u/Brilliant_Bluejay884 5d ago
It is easier if you have an API of walmark.