Skip to content

Instantly share code, notes, and snippets.

@nguyenphucbao68
Created April 1, 2017 11:04
Show Gist options
  • Save nguyenphucbao68/86ccef13c864989c25b682869bb22019 to your computer and use it in GitHub Desktop.
Save nguyenphucbao68/86ccef13c864989c25b682869bb22019 to your computer and use it in GitHub Desktop.
Run Code Ranking
; #FUNCTION# ====================================================================================================================
; Name ..........: _XulyRank
; Description ...: Tiền hành chạy hệ thống
; Syntax ........: _XulyRank()
; Author ........: Trojan Nguyen (Jack - New Username)
; ===============================================================================================================================_XulyRank()
Func _XulyRank()
Global $Array2d = Json_ObjCreate();
Local $access_token, $LimitTime, $ngay, $tuan, $thang, $id_group, $link, $i, $ArrayRanking[0][4]
$access_token= "Token của bạn"
$LimitTime = _DateDiff('s', "1970/01/01 00:00:00", _NowCalc()) ; Lấy time hiện tại (convert to seconds)
$ngay = 86400 ; tổng giây một ngày
$tuan = 604800 ; tổng giây một tuần
$thang = 2592000 ; tổng giây một tháng
$id_group = "ID group của bạn";Vd : 364997627165697 (J2team)
$link = "https://graph.facebook.com/v2.8/"&$id_group&"/feed?limit=500&fields=from,updated_time&access_token="&$access_token
_GetPost2($access_token, $link, $LimitTime-$thang)
For $tam in $Array2d
$tam = Json_get($Array2d, "."&$tam&"[id]")&"|"&Json_get($Array2d, "."&$tam&"[name]")&"|"&Json_get($Array2d, "."&$tam&"[points]")&"|"&Json_get($Array2d, "."&$tam&"[totalPosts]")
ConsoleWrite($tam)
_ArrayAdd($ArrayRanking, $tam)
Next
_ArrayDisplay($ArrayRanking)
;~ _ArraySort($ArrayRanking,1,0,0,2)
;~ _ArrayDisplay($ArrayRanking)
EndFunc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment