Archivatory Update #005 | RSS Feeds!

in #utopian-io6 years ago (edited)

archivatory-update-005.png

It was a light work week for me this past week due to being away with family but I did get the RSS feeds working!

Repository

https://github.com/jrswab/archivatory

Bug Fixes

Hard coded user URI array

This issue is a back end problem that made testing in staging and on the developments server more diffcult that I liked. Having to remember to change the array location every time was enough of a pain the first time that I did away with it as soon as possible. This was pushed to development early on and is now included in the master branch.

The solution was to use the end() and prev() functions that are built into PHP. The end() function tells PHP to move the pointer to the end of the array and prev() tells PHP to give me the item in the array before the current pointer. I chose to give end($URIArray) a variable to have it in case I needed to use it. Turns out I did not so just having it execute the end() function will be fine.

Archivatory Array Update

New Features

RSS Feeds

Creating the feed.php file for each user

This works in the same way that I made PHP check for the user profile but instead of only having it create on the user's landing page upon sign in I also added it to the profile pages. The idea here is to allow the consumer of the content to find an RSS feed even if the creator has not logged in since this update.

To start I set a variable to a shell_exec() function the runs the ls command with the username piped to grep feed. This will return with "feed.php" if the file exists in the user's directory. If not than the file is created without the need of mine or a staff member's manual effort.

archivatory feed check

Displaying only the content added to the user's playlist.

Since a user may not want all of their uploaded content to show in an RSS feed I chose to only have the RSS feed display content that the user added to their playlist. This was done by querying the database of file for the number 1 as we did with displaying the content into the user's playlist. Therefore, if a user changes their playlist or added to the playlist the feed will load the content accordingly.

archivatory grab user data for rss

GitHub Account

https://github.com/jrswab

All images came from royalty and attribution free sources unless specified.

If you have any questions about the future of Steem
or my witness please feel free to message jrswab#3134 on Discord.

vote-jrswab-for-steem-Witnesses—Steemit.gif

Click here to vote with SteemConnect!
Or go to https://steemit.com/~witnesses
You can see all active witnesses on @drakos' steemian.info


Click here to join the mailing list and get exclusive SDB/STEEM giveaways!

Looking to support my content creation efforts outside of the Steem Blockchain?
Check out jrswab.com/support


Mastodon | Keybase | Twitter | Gitlab | Hacker Culture Podcast

Sort:  

Thank you for your contribution.

  1. UTF-8 is recommended for your feed instead of ISO-8859-1
  2. shell_exec exposes a security concern in PHP. For example, you may want to use escapeshellargs to wrap your arguments
  3. Consider using a safer approach e.g. replace shell_exec("echo ".$feedPath." >> u/".$user."/feed.php"); with something like file_put_contents

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Thanks for the tips!

Hey @justyy
Here's a tip for your valuable feedback! @Utopian-io loves and incentivises informative comments.

Contributing on Utopian
Learn how to contribute on our website.

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Great work JR! Huge progress with this RSS feed.

Thanks again man! It's a blessing to have your support.

Hey @jrswab
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

@jrswab
Great work brother...
Kepp if up

Creative Your Presentation I Follow You, Finding Different Kinds of talent in you, I hope that you will always help us, I will always pray for you. I respect you deeply.

@tariqul95 the style of copy and paste commenting you are engaged in is considered comment spam. Spam diminishes the overall quality and authenticity of the Steem platforms. @steemflagrewards

Dear @spaminator (3 of 3), please add this user to your blacklist. Thank you.

Read the advice from the pros, bro: https://steemit.com/steemit-abuse/@spaminator/updated-your-reputation-could-be-a-tasty-snack-with-the-wrong-comment

Steem Flag Rewards mention comment has been approved! Thank you for reporting this abuse, @steemseph categorized as comment spam. This post was submitted via our Discord Community channel. Check us out on the following link!
SFR Discord

followup flag for comment spam @steemflagrewards

Steem Flag Rewards mention comment has been approved! Thank you for reporting this abuse, @mathowl categorized as comment spam. This post was submitted via our Discord Community channel. Check us out on the following link!
SFR Discord

Thank you for the kind words!

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 63281.14
ETH 2674.11
USDT 1.00
SBD 2.79