Librarian Search App - Built Using Python, Streamlit and HiveSQL

librariansearch.png

App Link: https://librariansearch.herokuapp.com/

Librarian Search is a continuation of my first App - Hive Librarian. Search parameters for looking up posts in Hive ended up being a long list. That's why I decide to make Librarian Search a separate App.

If you have used SteemSearch by @markangeltrueman, or SteemLookUp by @laniakea1 and @djordjeparovic in the past, you may find Librarian Search familiar. Because I used the similar model in making the App.

Librarian Search is built using Python, Streamlit and HiveSQL. Here is the link to GitHub repository for those who are interested to see the code:

https://github.com/librarian-hive/librarian-search

I hope all the parameter inputs for search are self explanatory. If not, please feel free to leave a feedback what improvements are needed to make things easier to understand.

Search Parameters

  1. Previously saved search parameters name: Normally it remains as "default" and uses default value. However, once changes are made, new parameters can be saved and can be used to autofill the input fields. Saving new parameters for future reference are at the bottom of the list of inputs.

  2. Number of Posts: Search result will return this number of posts. I put limit of max 500 posts for now. I think it should be more than enough.

  3. Start & End Date: This is a date range for the searched posts. It uses UTC date, because dates are stored in UTC on Hive.

  4. Start & End Time: Similar to date, but for time. Also uses UTC time.

  5. App used to post: This will get posts only published in one of the listed Apps/Tribes. But the default value is ALL.

  6. External Link: After results are returned, there is an option to visit the original post at the selected external link app/tribe. This will not work properly for Apps like DBUZZ, 3SPEAK, DPOLL and VIMM. Because formatting of links is in some of these apps is not same as with hive.blog or other condenser based apps. Hopefully, I will fix that in future. For now when one of these apps is selected, external link will default to hive.blog.

  7. Min & Max Author Rep: Authors' reputation.

  8. Min & Max Characters/Lengths: Amount of characters in the body of the post. I will try to change this into amount of words in the future.

  9. Min & Max Pending Payout: Based on how much posts are currently earning, but not yet paid out. Same as dollar amounts shown on hive.blog. When searching on tribe apps, the pending payout is still based on Hive payouts, and not the tribe tokens.

  10. Max & Min Number of Votes: Amount of votes the posts have received.

  11. Max & Min Number of Comments: Amount of comments the posts have received.

  12. Min & Max Hive Power: Total Hive Power the authors have. This add together both owned HP and received HP delegation.

  13. Include Tags: It will search all posts that have the tags listed. The next Any/All option will determine if all tags should appear in the post or any of of the tags should appear in the posts. Tags must be separated by space.

  14. Any or All tags should be included?: See number-13. This decided if any or all tags should appear in the searched posts. I may add similar option to some other search parameters too. For now only included tags have this option.

  15. Exclude Tags: Will exclude provided tags. Posts that may have any of the provided tags will be excluded. Tags must be space separated.

  16. Include Authors: The results will only show posts made by the provided list of authors. List of authors must be space separated.

  17. Exclude Authors: Posts made by any of the authors in the list will be excluded from the search results. The list must be space separated.

  18. Include Voters: This will only return posts upvoted by the provided list of accounts.

  19. Exclude Voters: If posts are upvoted by any of the users/accounts in the list, they will be excluded from the search results.

  20. Title Contains: Will only return posts that contain the words provided in the list. All words provided must appear in the post titles. I may need to add Any/All option to this in the future.

  21. Title Does Not Contain: Returned results must not contain words included in the list. This also follows ALL logic, only posts that contain all words listed are excluded. I need to add Any/All option here too.

  22. Body Contains: Similar to Title Contains but for body, the main content of the post.

  23. Body Does Not Contain: Similar to Title Does Not Contain but for the body, the main content of the post.

Most parameters are left empty by default. Only the parameters needed to achieve the desired results need to be changed. Once all parameters are set, clicking Get Posts will return the list of posts on the main content side of the window.

We may need to reuse the same parameters in the future. To make that easy there is an option to save the parameters. For that we need to give a name for these collection of parameters and click Save Parameters. Next time we need to use the same configuration, we just need to change Previously saved search parameters name: input at the top from default to the saved name reference. We can have as many different configurations saved separately for various cases.

While App stores all the names given for the collection of parameters, it does not display them. For future reference it may be easier to save the names somewhere locally.

Currently, there is known issue of not all posts being rendered properly from markdown to html. You may see some images not showing up, and instead visible as links. I tried to use various modules to improve that. But there are still issues here. I will try to fix that sometime in the future as well.

Please give Librarian Search a try. See if you find it useful, interesting, or not. Feel free to leave me feedback and suggestions for additions or improvements.

App Link: https://librariansearch.herokuapp.com/

Posted Using LeoFinance Beta



0
0
0.000
37 comments
avatar
(Edited)

Very nice, we have what we used to have again..., thanks @geekgirl!

EDIT: Words might be better than characters?

image.png

0
0
0.000
avatar
(Edited)

Yes, you are right words will be better. Word count isn't directly available in HiveSQL. The easiest fix I can think of is what @abh12345 suggested the other day, dividing the character count by 4 or 5. Other options will add more computation during query and may slow it down, that's why I didn't try yet. I will try different things to see if I can come up with a better solution. Thank you.

0
0
0.000
avatar

the number of words are probably much harder to get from HiveSQL than the number of characters. This would require to parse the body of each post, in the best even case after removing all HTML/Markdown syntax, not sure if this is reasonably possible...

0
0
0.000
avatar

wow, that's really impressive!! great work, thanks a lot!

Is there a way to hide the post content by default and give a (clickable?) list of titles instead, or show only teaser? With my first tries I got a couple of lengthy photo posts in the results with lots of text and lots of images. This made it harder to scroll through the results.

0
0
0.000
avatar

I will be working on making that happen. As you suggested, I want to show short form that can be expanded by a click. Since I am having issues properly rendering the markdown, I didn't bother doing that yet. I will try to fix the entire thing hopefully with better view, options, and proper rendering of the main content. Thank you.

0
0
0.000
avatar
(Edited)

I support this suggestion

Posted Using LeoFinance Beta

0
0
0.000
avatar

I added an option to display search results as title only or full content. And the full content can be expanded or hidden as needed. Later I will try to come up with better ways of displaying short and full forms of the content.

0
0
0.000
avatar

I took your suggestion and created an option to display search results as title only or full content. I will try to come up with something better later.

0
0
0.000
avatar

that's really cool, thank you!
works like a charm :)

0
0
0.000
avatar

This is so cool! Thank you @geekgirl
It's nice to finally see more search options coming for Hive users. What's the point of having so much content if there's no way to dig them out when you need them :)

Posted Using LeoFinance Beta

0
0
0.000
avatar

Such a beautiful creation here. I'll definitely use and give a feedback. I like it when we have enough tools to make our Hiving an interesting journey.

Posted Using LeoFinance Beta

0
0
0.000
avatar

One thing you may want to do is give a few display post options. When I ran a short search, the whole post show one on top of the other resulting in having to scroll and scroll, a quick view like on peakd or hive topic list where you get the thumbnail, the title and the description so a person can do a quick look and see if the post they were looking for showed up.

listtypeview.png

I don't know if it was chrome or if I missed a setting or not, but the above view would for me work better to find what I was looking for.

0
0
0.000
avatar

Thank you for the suggestion. That’s one of the first things I will try to fix/improve.

0
0
0.000
avatar

It worked pretty good, I limited my search to just ten, but I chose very long post in one of the criteria, a big min number.

0
0
0.000
avatar

I added an option to display search results as title only or full content. And the full content can be expanded or hidden as needed. Later I will try to come up with better ways of displaying short and full forms of the content.

0
0
0.000
avatar

Congratulations @geekgirl! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s) :

Your post has been really appreciated and was the most upvoted of the day

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Check out the last post from @hivebuzz:

Hive Tour Update - Communities
Hive Tour Update - Advanced posting
0
0
0.000
avatar

Congratulations @geekgirl! You received a personal badge!

You powered-up at least 10 HIVE on Hive Power Up Day! This entitles you to a level 1 badge.
Participate in the next Power Up Day and try to power-up more HIVE to get a bigger Power-Bee.
May the Hive Power be with you!

You can view your badges on your board and compare yourself to others in the Ranking

Check out the last post from @hivebuzz:

Feedback from the March 1st Hive Power Up Day
Hive Tour Update - Financial stages
0
0
0.000