Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --local htmlparser = require("htmlparser")
- concommand.Add( "testcommand", function( ply, cmd, args )
- local TheReturnedHTML = ""
- http.Fetch( "http://egamingbets.com/ru/tables#",
- function( body, len, headers, code )
- local sa = body
- --"sdfsdfsdfsdfsdfsdfsdfsdfsdf <span style='' ng-bind='gamer.full_nick()' class='ng-binding'>ByuN</span> sdfsdfsdfsdfsdfsdfsdfsdfsdf"
- function parse_me ( s )
- local string parse = {}; --Массив бла
- local find_one = false;
- local str_local = "";
- local findS = "<span style='' ng-bind='gamer.full_nick()' class='ng-binding'>";
- local str_r = find_syki(s,findS)
- --print(tostring(str_r)..":"..s[str_r])
- str_r = str_r + #findS
- --print(s[str_r])
- for i = str_r,#s do
- if (s[i]!="<") then str_local = str_local .. s[i] continue; end
- if (s[i] == "<" ) then
- table.insert(parse,str_local);
- str_local = "";
- break
- end
- end
- --print("len:"..tostring(#parse))
- return parse
- end
- function find_syki (s_1 , s_2)
- local ff = false;
- for i =1,#s_1 do
- if (s_1[i] == s_2[1]) then
- if check_line(s_1,s_2,i) then
- return i
- end
- end
- end
- return -1;
- end
- function check_line (s_1,s_2,i)
- jj = 1;
- --print("I:"..tostring(i).." "..s_1[i])
- for j=i,#s_1 do
- if (s_1[j] == s_2[jj]) then jj=jj+1; if (jj == #s_2) then return true end continue; end
- if (s_1[j] != s_2[jj]) then return false end
- --print(#s_2) print(tostring(j).." "..tostring(jj)) print(s_1[j] .. " != " .. s_2[jj])
- if (jj == #s_2) then return true end
- end
- return false
- end
- local tbl = parse_me(sa); --здесь типо будет таблица все что он нашел похожее дальше сам отсей
- for k,v in pairs (tbl) do
- print(v)
- end
- end)
- end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement