You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[SUGGESTION] A $videoid variable for the template property #28
This could be used to, for example, display the thumbnail of the video directly on the readme.md file, or can be used to get additional data about that video from youtube itself. Just a little thought I had while customizing my readme.md file with this.
@ConstantinDev including videoId as a parameter will go beyond the scope of this project. This project focuses on feed list gneration, i am not planning to include platform specific options other than the built in filters.
But i think adding a custom_tags argument that allows you to get the tags you are looking for on your template will be a good option.
Eg this is a youtube feed item:
<entry>
<id>yt:video:DPnJldwv22o</id>
<yt:videoId>DPnJldwv22o</yt:videoId>
<yt:channelId>UCDCHcqyeQgJ-jVSd6VJkbCw</yt:channelId>
<title>FREE Icons! How to use Bootstrap Icons v1.0.0 | Bootstrap 5 (2020)</title>
<link rel="alternate" href="https://www.youtube.com/watch?v=DPnJldwv22o"/>
<author>
<name>codeSTACKr</name>
<uri>https://www.youtube.com/channel/UCDCHcqyeQgJ-jVSd6VJkbCw</uri>
</author>
<published>2020-09-05T14:00:02+00:00</published>
<updated>2020-09-07T16:48:52+00:00</updated>
<media:group>
<media:title>FREE Icons! How to use Bootstrap Icons v1.0.0 | Bootstrap 5 (2020)</media:title>
<media:content url="https://www.youtube.com/v/DPnJldwv22o?version=3" type="application/x-shockwave-flash" width="640" height="390"/>
<media:thumbnail url="https://i1.ytimg.com/vi/DPnJldwv22o/hqdefault.jpg" width="480" height="360"/>
<media:description>👉 Sign up for my newsletter to stay up-to-date on my new course: https://codestackr.com Did you know that Bootstrap has its own icon library? Apparently, they released the first stable version, 1.0.0, last week. In this video, we'll look at how we can implement these with any of our projects even if we are not using Bootstrap. That's right! You can use these independent of Bootstrap. Bootstrap 5 is not required. Since these are MIT licensed and they are just SVGs, we can use them anywhere for FREE! Let me know what you think. Website: https://icons.getbootstrap.com/ Timestamps: 00:00 - Introduction 00:34 - Installation 01:34 - Embedding 03:07 - Sprite 04:34 - External Image 06:26 - CSS 08:32 - Style _____________________________________ 💖 Show support! PayPal: https://paypal.me/codeSTACKr _____________________________________ Watch Next: Web Development - Beginners Roadmap (2020) - https://youtu.be/iogabydg2y0 Playlist: Web Development For Beginners - https://www.youtube.com/watch?v=Ez4yHS2dsN8&list=PLkwxH9e_vrAJ0WbEsFA9W3I1W-g_BTsbt _____________________________________ Connect With Me: Website: http://www.codestackr.com Twitter: https://twitter.com/codeSTACKr Instagram: https://instagram.com/codeSTACKr Facebook: https://facebook.com/codeSTACKr _____________________________________ ** Affiliate Disclaimer: Some of the above links may be affiliate links, which may generate me a sales commission at no additional cost to you. #codeSTACKr #bootstrap5 #icons</media:description>
<media:community>
<media:starRating count="346" average="4.95" min="1" max="5"/>
<media:statistics views="6093"/>
</media:community>
</media:group>
</entry>
You can pass custom_tags: videoId/yt:videoId/,channelId/yt:channelId/ this will give you yt:channelId as $channelId and yt:videoId as $videoId in the template.
Just completed this feature now you will be able to use the custom tags as follows:
Lets say you have the following feed entry:
<entry>
<id>yt:video:DPnJldwv22o</id>
<yt:videoId>DPnJldwv22o</yt:videoId>
<yt:channelId>UCDCHcqyeQgJ-jVSd6VJkbCw</yt:channelId>
<title>FREE Icons! How to use Bootstrap Icons v1.0.0 | Bootstrap 5 (2020)</title>
<linkrel="alternate"href="https://www.youtube.com/watch?v=DPnJldwv22o"/>
<author>
<name>codeSTACKr</name>
<uri>https://www.youtube.com/channel/UCDCHcqyeQgJ-jVSd6VJkbCw</uri>
</author>
<published>2020-09-05T14:00:02+00:00</published>
<updated>2020-09-07T16:48:52+00:00</updated>
<media:group>
<media:title>FREE Icons! How to use Bootstrap Icons v1.0.0 | Bootstrap 5 (2020)</media:title>
<media:contenturl="https://www.youtube.com/v/DPnJldwv22o?version=3"type="application/x-shockwave-flash"width="640"height="390"/>
<media:thumbnailurl="https://i1.ytimg.com/vi/DPnJldwv22o/hqdefault.jpg"width="480"height="360"/>
<media:description>👉 Sign up for my newsletter to stay up-to-date on my new course: https://codestackr.com Did you know that Bootstrap has its own icon library? Apparently, they released the first stable version, 1.0.0, last week. In this video, we'll look at how we can implement these with any of our projects even if we are not using Bootstrap. That's right! You can use these independent of Bootstrap. Bootstrap 5 is not required. Since these are MIT licensed and they are just SVGs, we can use them anywhere for FREE! Let me know what you think. Website: https://icons.getbootstrap.com/ Timestamps: 00:00 - Introduction 00:34 - Installation 01:34 - Embedding 03:07 - Sprite 04:34 - External Image 06:26 - CSS 08:32 - Style _____________________________________ 💖 Show support! PayPal: https://paypal.me/codeSTACKr _____________________________________ Watch Next: Web Development - Beginners Roadmap (2020) - https://youtu.be/iogabydg2y0 Playlist: Web Development For Beginners - https://www.youtube.com/watch?v=Ez4yHS2dsN8&list=PLkwxH9e_vrAJ0WbEsFA9W3I1W-g_BTsbt _____________________________________ Connect With Me: Website: http://www.codestackr.com Twitter: https://twitter.com/codeSTACKr Instagram: https://instagram.com/codeSTACKr Facebook: https://facebook.com/codeSTACKr _____________________________________ ** Affiliate Disclaimer: Some of the above links may be affiliate links, which may generate me a sales commission at no additional cost to you. #codeSTACKr #bootstrap5 #icons</media:description>
<media:community>
<media:starRatingcount="346"average="4.95"min="1"max="5"/>
<media:statisticsviews="6093"/>
</media:community>
</media:group>
</entry>
Use the following code To get yt:channelId and yt:videoId in the template as channelId and videoId respectively:
name: Latest blog post workflowon:
schedule: # Run workflow automatically
- cron: '0 * * * *'# Runs every hour, on the hourworkflow_dispatch: # Run workflow manually (without waiting for the cron to be called), through the Github Actions Workflow page directlyjobs:
update-readme-with-blog:
name: Update this repo's README with latest blog postsruns-on: ubuntu-lateststeps:
- uses: actions/checkout@v2
- uses: gautamkrishnar/blog-post-workflow@masterwith:
feed_list: "https://example.com/feeds"custom_tags: "channelId/yt:channelId/,videoId/yt:videoId/"template: [$title]($url) $channelId $videoId
Take your example in your comment from Sep, 21 2020. There you have a tag <media:thumbnail url="https://i1.ytimg.com/vi/DPnJldwv22o/hqdefault.jpg" width="480" height="360"/>. My feed has exactly the same tag and I want to use the url property.
@kristofzerbe right now there isn't any API to do that. if you are trying to include the youtube video's thumbnail I recommend you to use the youtube API. Get the video ID using the above example and use the following API to return the image:
@gautamkrishnar ... hhmm, I don't understand you answer yet. Let me explain my thoughts:
You have implemented custom_tags for getting the content of a tag inside an entry of a feed. Like yt:channelId in your example.
But there are other tags in the feed, which carry their information not in the content, but in a named property, like <media:thumbnail url="" /> or <media:starRating count="" />.
My question is now, how do I get the value of those properties, for example count in the tag media:starRating?
@kristofzerbe sorry, unfortunately as far as I know the library i am using to parse the rss feeds do not support that. That's why I am unable to implement that as a feature. This is a non standard use case btw.
Hi @gautamkrishnar ... You are right. RSS-Parser doesn't provide attributes of entry tags yet. I have created a pull request to achieve that ... see rbren/rss-parser#224
With this change users of blog-post-workflow should be able to write custom_tags: "mediaThumbnailUrl/media:thumbnail.url/", to get the value of url out the tag media:thumbnail into the field mediaThumbnailUrl, if you decide to use this changed version.
Activity
gautamkrishnar commentedon Sep 20, 2020
@ConstantinDev including
videoIdas a parameter will go beyond the scope of this project. This project focuses on feed list gneration, i am not planning to include platform specific options other than the built in filters.But i think adding a
custom_tagsargument that allows you to get the tags you are looking for on your template will be a good option.Eg this is a youtube feed item:
You can pass
custom_tags: videoId/yt:videoId/,channelId/yt:channelId/this will give youyt:channelIdas $channelId andyt:videoIdas $videoId in the template.This feature is not available yet.
gautamkrishnar commentedon Sep 20, 2020
I will work on this when i have time. Lets keep this issue open so that someone else can pick it up if they are interested.
gautamkrishnar commentedon Sep 21, 2020
Just completed this feature now you will be able to use the custom tags as follows:
Lets say you have the following feed entry:
Use the following code To get
yt:channelIdandyt:videoIdin the template aschannelIdandvideoIdrespectively:DenverCoder1 commentedon Oct 2, 2020
Thanks @gautamkrishnar! I was about to open an issue, but I'm glad I checked here because this is exactly what I was looking for.
kristofzerbe commentedon Jan 30, 2022
Hi @gautamkrishnar ... this feature helps a lot, but one question: How do I reference a property of a tag, for example
media:thumbnail>url?gautamkrishnar commentedon Jan 30, 2022
@kristofzerbe can you share an RSS feed example for the same?
kristofzerbe commentedon Jan 30, 2022
Take your example in your comment from Sep, 21 2020. There you have a tag
<media:thumbnail url="https://i1.ytimg.com/vi/DPnJldwv22o/hqdefault.jpg" width="480" height="360"/>. My feed has exactly the same tag and I want to use theurlproperty.gautamkrishnar commentedon Jan 30, 2022
@kristofzerbe right now there isn't any API to do that. if you are trying to include the youtube video's thumbnail I recommend you to use the youtube API. Get the video ID using the above example and use the following API to return the image:
Example: https://img.youtube.com/vi/DPnJldwv22o/hqdefault.jpg
You can use the above in combination with the templates to generate a table. You can refer this as an example: https://github.com/Dexters-Hub/Dexters-Hub/blob/master/.github/workflows/youtube-workflow.yml
kristofzerbe commentedon Jan 30, 2022
@gautamkrishnar ... hhmm, I don't understand you answer yet. Let me explain my thoughts:
You have implemented
custom_tagsfor getting the content of a tag inside anentryof a feed. Likeyt:channelIdin your example.But there are other tags in the feed, which carry their information not in the content, but in a named property, like
<media:thumbnail url="" />or<media:starRating count="" />.My question is now, how do I get the value of those properties, for example
countin the tagmedia:starRating?gautamkrishnar commentedon Jan 30, 2022
@kristofzerbe as I mentioned earlier. It is not supported. You can only access values that are wrapped by a tag. Example:
You cant access the named properties of tags.
kristofzerbe commentedon Jan 30, 2022
Do you see any chance to handle my question as a feature request?
gautamkrishnar commentedon Jan 30, 2022
@kristofzerbe sorry, unfortunately as far as I know the library i am using to parse the rss feeds do not support that. That's why I am unable to implement that as a feature. This is a non standard use case btw.
kristofzerbe commentedon Jan 30, 2022
Hi @gautamkrishnar ... You are right. RSS-Parser doesn't provide attributes of entry tags yet. I have created a pull request to achieve that ... see rbren/rss-parser#224
With this change users of blog-post-workflow should be able to write
custom_tags: "mediaThumbnailUrl/media:thumbnail.url/", to get the value ofurlout the tagmedia:thumbnailinto the fieldmediaThumbnailUrl, if you decide to use this changed version.gautamkrishnar commentedon Jan 30, 2022
@kristofzerbe That's great. Will upgrade once they merge it. 👍🏻
Added custom tags feature, fixes: gautamkrishnar#28