youtuber

Receiving data StringRegExp jQuery

5 posts in this topic

#1 ·  Posted (edited)

Hi, how can I get data jQuery

#include <Array.au3>
#include <String.au3>
$Url = InetRead("http://www.millipiyango.gov.tr/sonuclar/_cs_sanstopu.php",0)
$Url = BinaryToString($Url, 4)
$receivedata = StringRegExp($Url, '(?i)sanstopu-hafta">(.*?)</span>', 3)
MsgBox(0,"test", "Hafta:",$receivedata[0])

 

Edited by youtuber

Share this post


Link to post
Share on other sites



The number to get is dynamically javascript generated depending on the date  ;)

$date = "29/06/2016"
$code = StringRegExpReplace($date, '(\d+)/(\d+)/(\d+)', "$3$2$1")
$url = "http://www.millipiyango.gov.tr/sonuclar/cekilisler/sanstopu/" & $code & ".json"
$data = BinaryToString(InetRead($url))
$receivedata = StringRegExp($data, 'hafta":(\d+)', 1)
MsgBox(0,"test", "Hafta:" & $receivedata[0])

 

1 person likes this

Share this post


Link to post
Share on other sites

In the source code of the main page I saw this :

function tarihSecildi (item) {
	var url = 'cekilisler/sanstopu/' + item.value + '.json';      <<<<<<<<<<<<<<<<<<<<<<<<<<<<
	jQuery.getJSON(url, function(json) {
		jQuery('#sanstopu-hafta').html(json.data.hafta);          <<<<<<<<<<<<<<<<<<<<<<<<<<<<

"item.value" = date,  "cekilisler/sanstopu/+date+.json" = name of the json, "#sanstopu-hafta" =  data to get  :)

1 person likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now