UlogsV2 Development Tasks Part II

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@petertag·
0.000 HBD
UlogsV2 Development Tasks Part II
[Repository: UlogsV2](https://github.com/surpassinggoogle/UlogsV2)

These are the rest of the tasks I picked up from [@surpassinggoogle](https://steemit.com/@surpassinggoogle) for Ulogs, and they were a bit harder. The pull request is [here](https://github.com/surpassinggoogle/UlogsV2/pull/154), and the task request is once again [here](https://steemit.com/utopian-io/@surpassinggoogle/task-request-add-core-features-and-communities-to-ulogs-org-880-steem-bounty-and-more).

Edit: I'm including [this PR](https://github.com/surpassinggoogle/UlogsV2/pull/156) as well, with test logging removal and request loading icon addition, since it's the same task.

### Adding Videos to the Banner (Task 4)

This was easier than expected though, because react has a massive base of tools to use. I used react-player (but only imported the YouTube player, since they were all from there) to embed videos into the banner. The videos are a bit sketchy looking, due to the resolution, but their appearance can easily be changed with CSS. I put them in at 100% width, so that there wouldn't be white space hanging around in the banner, and don't think it looks bad at all.

### Create a Ulogs-Subtags Page (Task 6)

For this, I was to create a page for ulogs that's similar to steemit's [tags page](https://www.steemit.com/tags). It wasn't too hard, but was the first time I really built a react component by myself! Yay! The page looks like this:
![Screen Shot 2018-12-12 at 4.15.16 PM.png](https://cdn.steemitimages.com/DQmNhni4ckvHcoa7N9vFywC34dNjPrivRCsreozbYu1Tt6t/Screen%20Shot%202018-12-12%20at%204.15.16%20PM.png)

The component wasn't really the issue to building this page, as much as the steem API was. Looking at steem's page, they use the deprecated getState('/tags')

, which isn't something to be using when it's been deprecated in favor of something else. So, I wrote a new API helper in ulogs to get the trending tags, using the tags_api, and return them to the ulog-subtags page.

![Screen Shot 2018-12-12 at 4.15.50 PM.png](https://cdn.steemitimages.com/DQmdUFw2d7LWWvq3X8PCozLiEttbN7sPNiLwTjxagJWKFwu/Screen%20Shot%202018-12-12%20at%204.15.50%20PM.png)

The start value is weird, as it's the first tag to return in the list of trending tags, so I just went with ulogs as it's the most trending of the ulog subtags. The limit is maxed at 1000, so that's the default value (not an expensive call). Then I return to the ulog-subtags component, and filter out all the non-ulogs tags.

![Screen Shot 2018-12-12 at 4.15.39 PM.png](https://cdn.steemitimages.com/DQmct86sHSXHGQZVqEBLpVyFATdsNzvZBnbRQX2b5renFGP/Screen%20Shot%202018-12-12%20at%204.15.39%20PM.png)

This logic could probably be rewritten a little bit (removing the logs after this post, didn't notice I left so many in there) for clarity and speed, but it's been pared down from a much larger function that was the first working one, down to this. Since there's a 1000 tag limit on the API call, it loops around a few times, getting more tags and adding them to the final array. Within 10 calls, you get the tags seen in the previous picture, and the next ulog-subtag shows up in the 39th call, so I left it at 10 since that isn't exactly trending, and it takes a bit for that many to load. After that, it returns the tags array to render them in the table.

That's just about it, if there's anything you notice, comment below or on Github. Cheers!

##### Vote For Me as Your Witness

Cheers, thanks for reading! If you like my tools and content and would like to see more, [Vote for me as witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=petertag&approve=1) or [proxy your votes](https://v2.steemconnect.com/sign/account-witness-proxy?proxy=petertag&approve=1) and I'll pick the best witnesses for you!

###### My Projects

[Pywit](https://www.github.com/gitschwifty/pywit.git)- A witness tool-kit built in Python on top of Holger80's Beempy.
👍 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,