WordPress Post : http://junn.net/archives/575

Github source :

  1. https://github.com/junn279/steemjs_example/blob/master/steem03_1.php (lite version)
  2. https://github.com/junn279/steemjs_example/blob/master/steem03.php

 

Continue to our previous example, this time I’ll introduce get_discussions_… functions.

I don’t know why, but functions are named like as below.

์ง€๋‚œ ํฌ์ŠคํŒ…์— ์ด์–ด, get_discussion ํ•จ์ˆ˜๋ฅผ ์ด์šฉํ•ด 20๊ฐœ ์ด์ƒ์˜ ์ž๋ฃŒ, ์—ฐ์†๋˜๋Š” ์ž๋ฃŒ ๋ฐ›๊ธฐ๋ฅผ ํ™•์ธํ•ด๋ณผ ์˜ˆ์ •์ด๋‹ค. ํ•จ์ˆ˜ ์ด๋ฆ„์„ ์™œ discussion์ด๋ผ๊ณ  ํ–ˆ๋Š”์ง€ ์ž˜ ๋ชจ๋ฅด๊ฒ ๋‹ค.

At this time, make a source like this. A Little bit different from previous sources, but this is more effective to view sequential 10, 20 (next 10) posts. I used getDiscussionsByCreated. Literally, byCreated means ‘retrieve posts in the order when they were created.

Look atย  ‘query’ and number of ‘limit’ is 11 not 10. Last one is for ‘retrieve next 10 posts’

๊ธฐ๋ณธ ํ‹€์„ ์œ„๊ณผ ๊ฐ™์ด ์žก๋Š”๋‹ค. ์ผ๋‹จ ๋ถˆ๋Ÿฌ์˜ค๋Š” ๊ฐฏ์ˆ˜๋ฅผ 11๋กœ ํ•œ ๊ฒƒ์€, ๋งˆ์ง€๋ง‰ ๋ฐ์ดํ„ฐ๋Š” ๋‹ค์Œ 10๊ฐœ๋ฅผ ๋ถˆ๋Ÿฌ์–ด์˜ค๊ธฐ ์œ„ํ•œ ๋ฐ์ดํ„ฐ๋กœ ํ•„์š”ํ•˜๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค.

As member variation of ‘query’ object, set start_author and start_permlink from last 11th post(but array index starts from number zero, so number 10 indicate the 11th post).

And then if you watch the developer console, you can see the retrieved posts.

But in this case, you should not put ‘inner query2~steem.api.getDis.. function’ out of first getDiscussionBy… function. Because steem.api is running synchronously.

I’m sure there is another way to run these sequential functions asynchronously. But I don’t know yet.

๋ฐ›์•„์˜จ ๋ฐ์ดํ„ฐ์˜ ๋งˆ์ง€๋ง‰(11๋ฒˆ์งธ; array์—์„œ index๋Š” 10) ํฌ์ŠคํŠธ์˜ ์ž๋ฃŒ๋ฅผ ์ด์šฉํ•ด์„œ ๋‹ค์Œ ๋‚ด์šฉ์„ ๋ถˆ๋Ÿฌ์˜จ๋‹ค. ํ•จ์ˆ˜ ๋‚ด๋ถ€์— ๋‹ค์‹œ ํ•จ์ˆ˜๋ฅผ ๋„ฃ์–ด์•ผํ•˜๋Š” ์ด์œ ๋Š” ๋™๊ธฐํ™”๋กœ ์ง„ํ–‰๋˜๋Š” ํ•จ์ˆ˜์ด๊ธฐ ๋•Œ๋ฌธ์— ๋ฐ–์œผ๋กœ ๋บ„ ๊ฒฝ์šฐ ์ œ๋Œ€๋กœ๋œ ๋ณ€์ˆ˜๊ฐ’์ด ์„ธํŒ…๋˜์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค.

 

Finally, I made a source using this function, put a button and by using it, we can get next 10 posts.

๋งˆ์ง€๋ง‰์œผ๋กœ ๋งŒ๋“  ์†Œ์Šค๋Š” ๋ฒ„ํŠผ์„ ์ด์šฉํ•ด์„œ ๊ณ„์†์ ์œผ๋กœ ํฌ์ŠคํŠธ๋ฅผ ์—ฐ์žฅํ•˜๋Š” ์†Œ์Šค์ด๋‹ค.

https://github.com/junn279/steemjs_example/blob/master/steem03.php

There is a ‘click’ button, and then you can get next 10 posts. These are match to what we can see through https://steemit.com/created/kr perfectly. (Be sure to be different from my result)

์•„๋ž˜์™€ ๊ฐ™์€ ๊ฒฐ๊ณผ๋ฅผ ๋งŒ๋“ค์–ด๋‚ด์—ˆ๋‹ค.

 

0 Shares:
1 comment
Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

You May Also Like
Read More

Steem Markdown to HTML

WordPress article : https://junn.net/archives/690 Source : https://github.com/junn279/steemjs_example/blob/master/steem05.htm ์ตœ๊ทผ ๋ช‡๋ช‡ ์˜์‚ฌ๋“ค์ด ๋ชจ์—ฌ ํ”„๋กœ์ ํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๊ณ  ์žˆ๋‹ค. Steem์— ์žˆ๋Š” ํŠน๋ณ„ํ•œ ํƒœ๊ทธ๋ฅผ…
Read More

Hyperledger (Private blockchain), Composer(Fabric), Sawtooth ์— ๋Œ€ํ•˜์—ฌ

Hyperledger ์€ Private blockchain tool์ž…๋‹ˆ๋‹ค. ๊ทธ๋Ÿฐ๋ฐ ํฌ์ŠคํŒ…์„ ์ฐพ์•„๋ด๋„ ์ตœ๊ทผ์—๋Š” ์ด ๊ฒƒ์— ๋Œ€ํ•ด ๊ธฐ์ˆ ํ•œ ๋‚ด์šฉ์ด ๋ณ„๋กœ ์—†์—ˆ์Šต๋‹ˆ๋‹ค. ์•„๋ฌด๋ž˜๋„ ์ฝ”์ธ์ด๋ž‘์€…
Read More

๋งฅ(Mac)์—์„œ ์ดํ•ดํ•˜๋Š” ๋„์ปค(Docker) #2. Hyperledger Sawtooth ์—ฐ๊ฒฐ๊นŒ์ง€

https://steemit.com/kr/@junn/mac-docker-1 ์— ์ด์€ Mac์—์„œ Docker ์ดํ•ดํ•˜๊ธฐ 2ํƒ„์ž…๋‹ˆ๋‹ค. ์ด๋ฒˆ ํฌ์ŠคํŒ…์€ ๋‹ค์Œ ์ˆœ์„œ๋กœ ์ง„ํ–‰๋ฉ๋‹ˆ๋‹ค. (1) ubuntu๋งŒ ์„ค์น˜๋œ image์— python์„ ์„ค์น˜ํ•œ…
Read More

Steemit ํฌ์ŠคํŠธ๋ฅผ OpenAPI๋กœ Naver ๋ธ”๋กœ๊ทธ๋กœ ๋ณด๋‚ด๊ธฐ(export) using PHP

Github : https://github.com/junn279/steemjs_example/blob/master/naver_open_api.php ์ œ๋ชฉ์€ Steemit ํฌ์ŠคํŠธ๋ฅผ Naver ๋ธ”๋กœ๊ทธ๋กœ ๋ณด๋‚ด๊ธฐ ์ž…๋‹ˆ๋‹ค. ๋ชจ๋“  ๊ณผ์ •์„ ํ•œ๋ฒˆ์— ์ ์„ ์ˆ˜๋Š” ์—†์–ด์„œ..์‚ฌ์‹ค์ƒ Naver OpenAPI…
Read More

Mediteam.us ๊ฐœ๋ฐœ – ์›Œ๋“œํ”„๋ ˆ์Šค๋ฅผ ๋ฐ”๊นฅ(์™ธ๋ถ€)์—์„œ ์ด์šฉํ•˜๊ธฐ(PHP), ์š”์•ฝ๋ฌธ(Excerpt)

์ŠคํŒ€์„ ์ฒ˜์Œ ๋ธ”๋กœ๊ทธ๋กœ ์‹œ์ž‘ํ•˜์‹ ๋ถ„๋“ค์€ ์‚ฌ์‹ค ์›Œ๋“œํ”„๋ ˆ์Šค๋ฅผ ์ตํž ์ด์œ ๊ฐ€ ์ „ํ˜€ ์—†์Šต๋‹ˆ๋‹ค๋งŒ, ์ €์ฒ˜๋Ÿผ ์˜ค๋žซ๋™์•ˆ ์›Œ๋“œํ”„๋ ˆ์Šค๋ฅผ ์‚ฌ์šฉํ•˜๋˜ ์‚ฌ๋žŒํ•œํ…Œ๋Š” ์›Œ๋“œํ”„๋ ˆ์Šค๊ฐ€ ์ŠคํŒ€ ๊ธ€์“ฐ๊ธฐ์˜…

WP User frontend์—์„œ custom form, Meta Key ์ด์šฉ

2019.02.09: ์ด ํฌ์ŠคํŒ…์€ WP 4๋ฅผ ๊ธฐ์ค€์œผ๋กœ ๋งŒ๋“ค์–ด์กŒ๋˜ ๊ฒƒ์œผ๋กœ WP 5์—์„œ๋Š” ํ…Œ์ŠคํŠธ๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.   ์ฐธ๊ณ  :ย http://docs.wedevs.com/docs/wp-user-frontend-pro/tutorials/showing-meta-fields-in-frontend/ 1. wordpress ๋‚ด๋ถ€…