Scraper utk menyimpan real time feeds ke database

 

Target web: https://www.indopremier.com/ipotstock/liveTradeWindowed.php

web tersebut di atas mendapatkan 'kiriman' real time feeds (dalam bentuk JSON data) dari https://www.indopremier.com/module/saham/include/livetrade-streaming.php

Real time feeds akan berjalan dgn jadwal berikut:

  1. Senin - Kamis: 9.15 - 12.15 dan 13.45 - 16.05
  2. Jumat: 9.15 - 11.45 dan 14.15 - 16.05

Scraper merupakan Javascript (pakai EventSource) yg ditulis dalam PHP.

Ketika dijalankan, scraper berfungsi untuk merekam, parsing real time feeds (server mengirimkan dalam bentuk JSON data), dan menyimpan ke dalam database MySQL localhost.

contoh JSON data:

id: 0
data: {"code":"13:31:53","data":{"Time":"13:31:53","TradeCommand":"0","SecurityCode":"SMBR","BoardCode":"RG","TradeNum":"000377613023","Price":"2420","Volume":44,"BuyerCode":"CS","BuyerType":"F","SellerCode":"LG","SellerType":"D","PrevPrice":"2400","TmpVar1":"000842681006","TmpVar2":"000842603483","Chg":"20","TmpVar4":"0","TmpVar5":"1\r","fmtPrice":"2,420 ","fmtChg":"20 ","fmtVolume":"44 ","fmtLabelSector":"basic"}}

Kolom pd tabel database localhost:

  1. Date (YYYY-MM-DD)
  2. Time
  3. TradeCommand
  4. SecurityCode
  5. BoardCode
  6. TradeNum
  7. Price
  8. Volume
  9. BuyerCode
  10. BuyerType
  11. SellerCode
  12. SellerType
  13. PrevPrice
  14. TmpVar1
  15. TmpVar2
  16. Chg
  17. TmpVar4
  18. TmpVar5
  19. fmtPrice
  20. fmtChg
  21. fmtVolume
  22. fmtLabelSector
Dalam PHP ada tombol "START" dan "STOP". START utk memulai aktivitas membangun koneksi, parsing, dan simpan data ke database. STOP utk menghentikan smua aktivitas tersebut.

Tampilan tidak penting. Buat sesederhana mungkin.

Budget <= Rp150.000

saya punya beberapa contoh javascript dalam PHP yg mungkin bs jd acuan dan selanjutnya dikembangkan sendiri. ada di attachment.

MySQL JavaScript PHP Web Scrapping

Project Class: Micro (Under 500rb)
Published Budget: Rp 150,000
Finish Days: 2
Published Date: 21/11/2016 14:57:52 WIB
Start Date:
Project Status: No Action
Accepted Worker:
Accepted Budget: Rp 0
Project Ending:
Finish Date:

Project Owner

tommytama
    
10.00/10.00
62 Point
#1,375 dari 96,545

Accepted Worker

Bid masih terbuka.

Place New Bid

  User Bids

appzone
    
9.84/10.00

stevevanchristie
    
9.50/10.00

ilmu13
    
0.00/10.00

azanakbar
    
0.00/10.00

Recommended Workers

Iswanto

9,461 points
174 projects
    
9.54/10.00

rolldev

4,167 points
8 projects
    
8.67/10.00

mas.adi

4,414 points
19 projects
    
9.74/10.00

idlamalif

4,422 points
77 projects
    
9.86/10.00

steven.comptia

5,902 points
197 projects
    
9.89/10.00

Recommended Services

Pembuatan template website

Rp 300,000
8 sales
    
10.00/10.00

Pembuatan bot line

Rp 1,500,000
2 sales
    
10.00/10.00

Jasa Pembuatan Website Streaming Film

Rp 750,000
3 sales
    
9.33/10.00

Jasa pembuatan website portal berita auto content

Rp 950,000
2 sales
    
10.00/10.00

Open Projects

LARAVEL PROJECT ONSITE JAKARTA

Open to SuggestionsOwner: MeityRose
Deadline: 7 days

Odoo 10: Customize Bill of Material and Warehouse Permission

Rp 600,000Owner: agungsuyono
Deadline: 7 days

pembuatan website semi ecomerce

Rp 3,500,000Owner: adunk123
Deadline: 7 days

Project CRUD dan PRINT PHP

Open to SuggestionsOwner: juragankas
Deadline: 7 days