How to get KeyValueList with HTTP Request?

#1

I found this topic: HTTP API SQLite Access

But there we only get Keys or Value from Keys.

How can I get KeyValueList from Section inside a table?

0 Likes

#2

There is no way as of right now, no.

0 Likes

#3

Hmm okay - I made a custom script, that creates me a JSON-File with the data currently. That’s maybe better cause of caching and so on :thinking: - the HTTP Request would just be more accurate - but thanks for your answer

0 Likes

#4

I was wrong.

Here you go:

http://localhost:25000/dbquery?table=table_name&getAllRows&webauth=webauth_value
http://localhost:25000/dbquery?table=table_name&getSortedRows&webauth=webauth_value
http://localhost:25000/dbquery?table=table_name&getSortedRowsByValue&webauth=webauth_value

"table": {
   "table_name":"command",
   "results":[
      {
         "key":"uptime",
         "value":"(pointtouser) (channelname) has been online for (uptime)"
      },
      {
         "key":"followage",
         "value":"(followage)"
      },
      {
         "key":"playtime",
         "value":"(pointtouser) (channelname) has been playing (game) for (playtime)"
      },
      {
         "key":"title",
         "value":"(pointtouser) (titleinfo)"
      },
      {
         "key":"game",
         "value":"(pointtouser) (gameinfo)"
      },
      {
         "key":"age",
         "value":"(age)"
      },
      {
         "key":"aa",
         "value":"(team_url thirstyaf)"
      },
      {
         "key":"team",
         "value":"This channel is a part of the team (team_name thirstyaf), you can find it at (team_url thirstyaf)! There's currently (team_members thirstyaf) members in the team! (team_random_member thirstyaf) is one of them!"
      },
      {
         "key":"teamshout",
         "value":"Hey there! You should go check out (team_static_random_member thirstyaf) over at https://twitch.tv/(team_static_random_member thirstyaf)"
      },
      {
         "key":"rand",
         "value":"(team_random_member thirstyaf) (team_random_member thirstyaf) (team_random_member thirstyaf)"
      },
      {
         "key":"a",
         "value":"asasd"
      },
      {
         "key":"rd",
         "value":"(team_member_game thirstyaf, (team_random_member thirstyaf)) (team_member_followers thirstyaf, (team_random_member thirstyaf)) (team_member_url thirstyaf, (team_random_member thirstyaf)) (team_random_member thirstyaf)"
      },
      {
         "key":"teamshoutout",
         "value":"Go check out (team_random_member thirstyaf) their current game is (team_member_game thirstyaf, (team_random_member thirstyaf)), and they have (team_member_followers thirstyaf, (team_random_member thirstyaf)) followers! (team_member_url thirstyaf, (team_random_member thirstyaf))"
      },
      {
         "key":"t",
         "value":"test"
      },
      {
         "key":"lines",
         "value":"this will be chat line 1\nthis will be chat line 2\nthis will be chat line 3\n4\n5\n6\n7"
      },
      {
         "key":"dd",
         "value":"line a \\n line b \\n hi"
      },
      {
         "key":"test",
         "value":"t"
      },
      {
         "key":"pl",
         "value":"PL : (playtime)"
      },
      {
         "key":"tt",
         "value":"(touser)"
      },
      {
         "key":"vw",
         "value":"some (views)"
      },
      {
         "key":"pt",
         "value":"sasda: (pointtouser)"
      },
      {
         "key":"lt",
         "value":"(lasttip)"
      },
      {
         "key":"hack",
         "value":"(pointtouser) (touser)"
      },
      {
         "key":"write",
         "value":"(writefile ../../scripts/init.js, true, my code)"
      },
      {
         "key":"read",
         "value":"(readfile mods.txt)"
      }
   ]
}```
0 Likes

#5

Sorry :slight_smile: Thats not what I need. Still can’t parse the section from the table. But thx

0 Likes

#6

Working on a PR to add support for a section parameter to the HTTP DBQuery API

1 Like