https://github.com/askareija/tokopediaapi
Simple rails plugin for get products from tokopedia
https://github.com/askareija/tokopediaapi
api rails rails-plugins ruby
Last synced: about 1 month ago
JSON representation
Simple rails plugin for get products from tokopedia
- Host: GitHub
- URL: https://github.com/askareija/tokopediaapi
- Owner: askareija
- License: mit
- Created: 2018-10-16T09:28:04.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-16T13:19:44.000Z (over 7 years ago)
- Last Synced: 2025-04-04T07:24:30.411Z (about 1 year ago)
- Topics: api, rails, rails-plugins, ruby
- Language: Ruby
- Size: 22.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
# TokopediaApi
## This plugin is still in pre-alpha version and has not been released and is still in the development stage.
A simple rails plugin to get products information from tokopedia.
## Usage
```ruby
require 'tokopedia_api'
```
### Get Product from url
```ruby
TokopediaApi.get_product(url)
```
example : `TokopediaApi.get_product("https://www.tokopedia.com/gandante/asus-strix-rog-gaming-gl553vd-i7-w-gtx-1050-4-gb")` \
the result will return a Hash class :
```
{:shop_id=>"440608", :product_id=>"173268998", :product_name=>"Asus STRIX ROG Gaming GL553VD i7 w/ GTX 1050 4 GB", :product_image=>"https://ecs7.tokopedia.net/img/cache/700/product-1/2017/12/25/173268998/173268998_7fcf9c49-3711-4562-ad05-b6d079cce7cd_2048_0.jpg", :product_link=>"https://www.tokopedia.com/gandante/asus-strix-rog-gaming-gl553vd-i7-w-gtx-1050-4-gb", :product_price=>"12999000", :product_desc=>"Assallamuallaikum Agan2 dan Sista2 , Kembali nih Ane Rizqi Dari GanDanteStore Mau jual Laptop High-End, Check It Out... Asus STRIX ROG Gaming GL553VD - Processor : Intel Core i7-7700 HQ 3.8 GHz - Memory : 8 GB DDR4 - Graphic : NVIDIA GeForce GDDR5X 1050 4 GB Dedicated - Storage : 1 TB 7200 RPM HDD - Display : 15.6\" Full HD IPS Wide-View Anti-Glare Matte - Connectivity : 3x USB 3.0 SuperSpeed, HDMI, headphone / mic combo jack, 802.11a/g/n WLAN, Bluetooth 4.0, Gigabyte Ethernet Mbps, Card Reader - Audio : ASUS ROG AudioWizard Rp. 12.999.000, - Kondisi : - Like New 99 % - RGB + NumPad Keyboard - Silent Cooling System - Garansi 2 Thn ASUS Resmi Sampai 2019 - BONUS : Game2 Terbaru + Softwares + Movies By Request Kelengkapan : - Laptop + Charger Original Note : - Barang ORIGINAL 100 % - Silahkan Kontak Saya untuk Konsultasi - Bisa COD Bandung - Total Harga dan Berat Barang sudah termasuk Biaya Ongkir, Paking Kayu, Bubble Warp, Asuransi serta Biaya Kurir & Jasa LINE : RIZQIDANTE FB FansPage : GanDanteStore IG : GanDanteStore Wesbite : www*GanDanteStore*com Terimakasih TokoPedia Wassallamuallaikum Wr.Wb.", :product_weight_kg=>"20.00", :menu_id=>"1241306", :menu_name=>"Laptop", :menu_url=>"https://www.tokopedia.com/gandante/etalase/laptop-1"}
```
Hash parameters
shop_id
Return the shop ID
product_id
Return the product ID
product_name
Return the product name
product_image
Return the product image link
product_link
Return the product link on tokopedia website
product_price
Return the price of the product
product_desc
Return the description of the product
product_weight_kg
Return the weight of the product in kilograms
menu_id
Return the menu ID (etalase)
menu_name
Return the menu name (etalase name)
menu_url
Return the url of the menu (etalase url)
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'tokopedia_api'
```
And then execute:
```bash
$ bundle
```
Or install it yourself as:
```bash
$ gem install tokopedia_api
```
## Contributing
You can contribute to this project to make it better, just ask me
## License
Created by Megumi Aliya © 2018
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).