• (022) 8788 2588

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
17 Point
#1,603 dari 71,958

Accepted Worker

Bid masih terbuka.

Place New Bid

  User Bids

appzone
    
9.81/10.00

stevevanchristie
    
10.00/10.00

ilmu13
    
0.00/10.00

azanakbar
    
0.00/10.00

Recommended Workers

lexdorf17

10,184 points
50 projects
    
9.65/10.00

bl4ck4nt

7,211 points
70 projects
    
9.12/10.00

Iswanto

3,869 points
69 projects
    
9.38/10.00

irvanseptian.com

3,187 points
19 projects
    
9.68/10.00

dimasdwib

3,122 points
18 projects
    
10.00/10.00

Recommended Services

Pembuatan template website

Rp 300,000
6 sales
    
10.00/10.00

e-commerce dengan Custom Produk Desain

Rp 1,000,000
1 sales
    
9.00/10.00

Jasa Pembuatan Website Streaming Film

Rp 650,000
1 sales
    
8.00/10.00

Open Projects

mikrokontroler

Rp 7,000,000Owner: agungmuhamad
Deadline: 30 days

Programmer Framework PHP Untuk Project Sistem Informasi

Rp 6,000,000Owner: DikaAgus
Deadline: 30 days

Pasang Iklan di Website Anda

Rp 50,000Owner: TaufiqIqbal
Deadline: 7 days

Membuat website Berita/ Magazine dengan template themeforrest

Open to SuggestionsOwner: Temmy15
Deadline: 5 days