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,682 dari 109,750

Accepted Worker

Bid masih terbuka.

Place New Bid

  User Bids

appzone
    
9.85/10.00

stevevanchristie
    
9.50/10.00

ilmu13
    
0.00/10.00

azanakbar
    
0.00/10.00

Recommended Workers

Iswanto

11,265 points
222 projects
    
9.58/10.00

mas.adi

7,144 points
22 projects
    
9.77/10.00

bl4ck4nt

10,727 points
82 projects
    
9.28/10.00

rolldev

4,167 points
8 projects
    
8.67/10.00

idlamalif

5,047 points
84 projects
    
9.86/10.00

Recommended Services

Pembuatan bot line

Rp 1,500,000
5 sales
    
10.00/10.00

Pembuatan template website

Rp 300,000
9 sales
    
10.00/10.00

Jasa Pembuatan Website Streaming Film

Rp 750,000
3 sales
    
9.33/10.00

Jasa Pembuatan Website Streaming Film / TV Series

Rp 650,000
2 sales
    
10.00/10.00

Open Projects

Website untuk Walet 1 halaman saja

Open to SuggestionsOwner: bintangmarket
Deadline: 7 days

bantu setting sms gateway directional connection 2 arah telkomsel

Open to SuggestionsOwner: helwie_ahmad
Deadline: 7 days

Pembuatan Website Online Shop

Rp 2,500,000Owner: irfankus
Deadline: 14 days

Pembuatan website Tour & Travel menggunakan Wordpress

Rp 1,000,000Owner: endarsw
Deadline: 7 days