Compare commits

...

15 Commits

Author SHA1 Message Date
github-actions[bot]
710df90361 Update version to v1.4.129 and commit 2025-01-03 20:42:19 +00:00
Eugen Eisler
f5d94bfde6 Merge pull request #1242 from CuriouslyCory/main
Adding youtube --metadata flag
2025-01-03 21:40:57 +01:00
Cory Sougstad
1629f36c59 Better metadata 2025-01-02 09:41:15 -07:00
Cory Sougstad
b4b8b96260 Added metadata lookup to youtube helper 2024-12-31 15:31:17 -07:00
Daniel Miessler
b07054adea Font familiy changes. 2024-12-31 13:58:37 -08:00
Daniel Miessler
ff21c60661 16 word summaries. 2024-12-31 11:30:42 -08:00
Daniel Miessler
dfc0efbb67 Updated wrapping instructions. 2024-12-28 21:32:24 -08:00
Daniel Miessler
d79449be4a Enhanced pattern. 2024-12-28 21:21:21 -08:00
Daniel Miessler
5c6b84e4ec Enhanced enrich pattern. 2024-12-28 21:00:23 -08:00
Daniel Miessler
0fcd4945fb Enhanced enrich pattern. 2024-12-28 20:37:39 -08:00
Daniel Miessler
c10ae1ddd2 Merge branch 'main' of github.com:danielmiessler/fabric 2024-12-28 20:27:24 -08:00
Daniel Miessler
9774692b67 Added enrich_blog_post 2024-12-28 20:27:17 -08:00
Eugen Eisler
e45f24c6fd Merge pull request #1230 from iqbalabd/translate-curly-braces
Update translate pattern to use curly braces
2024-12-27 14:44:29 +01:00
Iqbal Abdullah
fb416c26ea Update translate pattern to use curly braces 2024-12-27 09:50:53 +09:00
Daniel Miessler
e15280d25d Updated story to be shorter bullets. 2024-12-24 15:57:46 -08:00
51 changed files with 521 additions and 92 deletions

View File

@@ -211,7 +211,7 @@ yt() {
}
```
This also creates a `yt` alias that allows you to use `yt https://www.youtube.com/watch?v=4b0iet22VIk` to get your transcripts.
This also creates a `yt` alias that allows you to use `yt https://www.youtube.com/watch?v=4b0iet22VIk` to get transcripts, comments, and metadata.
#### Save your files in markdown using aliases
@@ -323,6 +323,7 @@ Application Options:
-y, --youtube= YouTube video "URL" to grab transcript, comments from it and send to chat
--transcript Grab transcript from YouTube video and send to chat (it used per default).
--comments Grab comments from YouTube video and send to chat
--metadata Grab metadata from YouTube video and send to chat
-g, --language= Specify the Language Code for the chat, e.g. -g=en -g=zh
-u, --scrape_url= Scrape website URL to markdown using Jina AI
-q, --scrape_question= Search question using Jina AI
@@ -474,16 +475,18 @@ alias pbpaste='xclip -selection clipboard -o'
## Web Interface
Fabric now includes a built-in web interface that provides a GUI alternative to the command-line interface and an out-of-the-box website for those who want to get started with web development or blogging.
You can use this app as a GUI interface for Fabric, a ready to go blog-site, or a website template for your own projects.
You can use this app as a GUI interface for Fabric, a ready to go blog-site, or a website template for your own projects.
The `web/src/lib/content` directory includes starter `.obsidian/` and `templates/` directories, allowing you to open up the `web/src/lib/content/` directory as an [Obsidian.md](https://obsidian.md) vault. You can place your posts in the posts directory when you're ready to publish.
The `web/src/lib/content` directory includes starter `.obsidian/` and `templates/` directories, allowing you to open up the `web/src/lib/content/` directory as an [Obsidian.md](https://obsidian.md) vault. You can place your posts in the posts directory when you're ready to publish.
### Installing
The GUI can be installed by navigating to the `web` directory and using `npm install`, `pnpm install`, or your favorite package manager. Then simply run the development server to start the app. 
The GUI can be installed by navigating to the `web` directory and using `npm install`, `pnpm install`, or your favorite package manager. Then simply run the development server to start the app.
_You will need to run fabric in a separate terminal with the `fabric --serve` command._
_You will need to run fabric in a separate terminal with the `fabric --serve` command._
**From the fabric project `web/` directory:**
```shell
npm run dev
@@ -491,7 +494,7 @@ npm run dev
pnpm run dev
## or your equivalent
## or your equivalent
```
### Streamlit UI
@@ -507,10 +510,12 @@ streamlit run streamlit.py
```
The Streamlit UI provides a user-friendly interface for:
- Running and chaining patterns
- Managing pattern outputs
- Creating and editing patterns
- Analyzing pattern results
## Meta
> [!NOTE]

View File

@@ -1,6 +1,7 @@
package cli
import (
"encoding/json"
"fmt"
"os"
"path/filepath"
@@ -286,7 +287,7 @@ func Cli(version string) (err error) {
func processYoutubeVideo(
flags *Flags, registry *core.PluginRegistry, videoId string) (message string, err error) {
if !flags.YouTubeComments || flags.YouTubeTranscript {
if (!flags.YouTubeComments && !flags.YouTubeMetadata) || flags.YouTubeTranscript {
var transcript string
var language = "en"
if flags.Language != "" || registry.Language.DefaultLanguage.Value != "" {
@@ -312,6 +313,16 @@ func processYoutubeVideo(
message = AppendMessage(message, commentsString)
}
if flags.YouTubeMetadata {
var metadata *youtube.VideoMetadata
if metadata, err = registry.YouTube.GrabMetadata(videoId); err != nil {
return
}
metadataJson, _ := json.MarshalIndent(metadata, "", " ")
message = AppendMessage(message, string(metadataJson))
}
return
}

View File

@@ -47,8 +47,9 @@ type Flags struct {
ChangeDefaultModel bool `short:"d" long:"changeDefaultModel" description:"Change default model"`
YouTube string `short:"y" long:"youtube" description:"YouTube video or play list \"URL\" to grab transcript, comments from it and send to chat or print it put to the console and store it in the output file"`
YouTubePlaylist bool `long:"playlist" description:"Prefer playlist over video if both ids are present in the URL"`
YouTubeTranscript bool `long:"transcript" description:"Grab transcript from YouTube video and send to chat (it used per default)."`
YouTubeTranscript bool `long:"transcript" description:"Grab transcript from YouTube video and send to chat (it is used per default)."`
YouTubeComments bool `long:"comments" description:"Grab comments from YouTube video and send to chat"`
YouTubeMetadata bool `long:"metadata" description:"Output video metadata"`
Language string `short:"g" long:"language" description:"Specify the Language Code for the chat, e.g. -g=en -g=zh" default:""`
ScrapeURL string `short:"u" long:"scrape_url" description:"Scrape website URL to markdown using Jina AI"`
ScrapeQuestion string `short:"q" long:"scrape_question" description:"Search question using Jina AI"`

View File

@@ -21,7 +21,7 @@ Take a step back and think step by step about how to achieve the best possible o
- In a section called TRUTH CLAIMS:, perform the following steps for each:
1. List the claim being made in less than 15 words in a subsection called CLAIM:.
1. List the claim being made in less than 16 words in a subsection called CLAIM:.
2. Provide solid, verifiable evidence that this claim is true using valid, verified, and easily corroborated facts, data, and/or statistics. Provide references for each, and DO NOT make any of those up. They must be 100% real and externally verifiable. Put each of these in a subsection called CLAIM SUPPORT EVIDENCE:.
3. Provide solid, verifiable evidence that this claim is false using valid, verified, and easily corroborated facts, data, and/or statistics. Provide references for each, and DO NOT make any of those up. They must be 100% real and externally verifiable. Put each of these in a subsection called CLAIM REFUTATION EVIDENCE:.

View File

@@ -16,8 +16,8 @@ You are a military historian and strategic analyst specializing in dissecting hi
- Only output in Markdown format.
- Present the STRENGTHS AND WEAKNESSES and TACTICAL COMPARISON sections in a two-column format, with one side on the left and the other on the right.
- Write the STRATEGIC DECISIONS bullets as exactly 20 words each.
- Write the PIVOTAL MOMENTS bullets as exactly 15 words each.
- Write the LOGISTICAL FACTORS bullets as exactly 15 words each.
- Write the PIVOTAL MOMENTS bullets as exactly 16 words each.
- Write the LOGISTICAL FACTORS bullets as exactly 16 words each.
- Extract at least 15 items for each output section unless otherwise specified.
- Do not give warnings or notes; only output the requested sections.
- Use bulleted lists for output, not numbered lists.

View File

@@ -18,9 +18,9 @@ Take a deep breath and think step by step about how to best accomplish this goal
- Extract the list of organizations the authors are associated, e.g., which university they're at, with in a section called AUTHOR ORGANIZATIONS.
- Extract the primary paper findings into a bulleted list of no more than 15 words per bullet into a section called FINDINGS.
- Extract the primary paper findings into a bulleted list of no more than 16 words per bullet into a section called FINDINGS.
- Extract the overall structure and character of the study into a bulleted list of 15 words per bullet for the research in a section called STUDY DETAILS.
- Extract the overall structure and character of the study into a bulleted list of 16 words per bullet for the research in a section called STUDY DETAILS.
- Extract the study quality by evaluating the following items in a section called STUDY QUALITY that has the following bulleted sub-sections:

View File

@@ -65,7 +65,7 @@ Common examples that meet this criteria:
"D - Stale" -- Significant use of cliche and/or weak language.
"F - Weak" -- Overwhelming language weakness and/or use of cliche.
6. Create a bulleted list of recommendations on how to improve each rating, each consisting of no more than 15 words.
6. Create a bulleted list of recommendations on how to improve each rating, each consisting of no more than 16 words.
7. Give an overall rating that's the lowest rating of 3, 4, and 5. So if they were B, C, and A, the overall-rating would be "C".

View File

@@ -69,7 +69,7 @@ Common examples that meet this criteria:
"D - Stale" -- Significant use of cliche and/or weak language.
"F - Weak" -- Overwhelming language weakness and/or use of cliche.
6. Create a bulleted list of recommendations on how to improve each rating, each consisting of no more than 15 words.
6. Create a bulleted list of recommendations on how to improve each rating, each consisting of no more than 16 words.
7. Give an overall rating that's the lowest rating of 3, 4, and 5. So if they were B, C, and A, the overall-rating would be "C".

View File

@@ -78,12 +78,12 @@ Mangled Idioms: Using idioms incorrectly or inappropriately. Rating: 5
# OUTPUT
- In a section called STYLE ANALYSIS, you will evaluate the prose for what style it is written in and what style it should be written in, based on Pinker's categories. Give your answer in 3-5 bullet points of 15 words each. E.g.:
- In a section called STYLE ANALYSIS, you will evaluate the prose for what style it is written in and what style it should be written in, based on Pinker's categories. Give your answer in 3-5 bullet points of 16 words each. E.g.:
"- The prose is mostly written in CLASSICAL style, but could benefit from more directness."
"Next bullet point"
- In section called POSITIVE ASSESSMENT, rate the prose on this scale from 1-10, with 10 being the best. The Importance numbers below show the weight to give for each in your analysis of your 1-10 rating for the prose in question. Give your answers in bullet points of 15 words each.
- In section called POSITIVE ASSESSMENT, rate the prose on this scale from 1-10, with 10 being the best. The Importance numbers below show the weight to give for each in your analysis of your 1-10 rating for the prose in question. Give your answers in bullet points of 16 words each.
Clarity: Making the intended message clear to the reader. Importance: 10
Brevity: Being concise and avoiding unnecessary words. Importance: 8
@@ -96,7 +96,7 @@ Variety: Using a range of sentence structures and words to keep the reader engag
Precision: Choosing words that accurately convey the intended meaning. Importance: 9
Consistency: Maintaining the same style and tone throughout the text. Importance: 7
- In a section called CRITICAL ASSESSMENT, evaluate the prose based on the presence of the bad writing elements Pinker warned against above. Give your answers for each category in 3-5 bullet points of 15 words each. E.g.:
- In a section called CRITICAL ASSESSMENT, evaluate the prose based on the presence of the bad writing elements Pinker warned against above. Give your answers for each category in 3-5 bullet points of 16 words each. E.g.:
"- Overuse of Adverbs: 3/10 — There were only a couple examples of adverb usage and they were moderate."
@@ -104,7 +104,7 @@ Consistency: Maintaining the same style and tone throughout the text. Importance
- In a section called SPELLING/GRAMMAR, find all the tactical, common mistakes of spelling and grammar and give the sentence they occur in and the fix in a bullet point. List all of these instances, not just a few.
- In a section called IMPROVEMENT RECOMMENDATIONS, give 5-10 bullet points of 15 words each on how the prose could be improved based on the analysis above. Give actual examples of the bad writing and possible fixes.
- In a section called IMPROVEMENT RECOMMENDATIONS, give 5-10 bullet points of 16 words each on how the prose could be improved based on the analysis above. Give actual examples of the bad writing and possible fixes.
## SCORING SYSTEM

View File

@@ -24,15 +24,15 @@ Your code here
**OUTPUT INSTRUCTIONS**
Only output Markdown.
Write the IDEAS bullets as exactly 15 words.
Write the IDEAS bullets as exactly 16 words.
Write the RECOMMENDATIONS bullets as exactly 15 words.
Write the RECOMMENDATIONS bullets as exactly 16 words.
Write the HABITS bullets as exactly 15 words.
Write the HABITS bullets as exactly 16 words.
Write the FACTS bullets as exactly 15 words.
Write the FACTS bullets as exactly 16 words.
Write the INSIGHTS bullets as exactly 15 words.
Write the INSIGHTS bullets as exactly 16 words.
Extract at least 25 IDEAS from the content.

View File

@@ -110,7 +110,7 @@ Im going to continue thinking on this. I hope you do as well, and let me know
# OUTPUT SECTIONS
- In a section called NEGATIVE FRAMES, output 1 - 5 of the most negative frames you found in the input. Each frame / bullet should be wide in scope and be less than 15 words.
- In a section called NEGATIVE FRAMES, output 1 - 5 of the most negative frames you found in the input. Each frame / bullet should be wide in scope and be less than 16 words.
- Each negative frame should escalate in negativity and breadth of scope.
@@ -120,7 +120,7 @@ E.g.,
"Dating is hopeless at this point."
"Why even try in this life if I can't make connections?"
- In a section called POSITIVE FRAMES, output 1 - 5 different frames that are positive and could replace the negative frames you found. Each frame / bullet should be wide in scope and be less than 15 words.
- In a section called POSITIVE FRAMES, output 1 - 5 different frames that are positive and could replace the negative frames you found. Each frame / bullet should be wide in scope and be less than 16 words.
- Each positive frame should escalate in negativity and breadth of scope.

View File

@@ -10,11 +10,11 @@ Take a deep breath and think step by step about how to best accomplish this goal
- Output a summary of how the project works in a section called SUMMARY:.
- Output a step-by-step guide with no more than 15 words per point into a section called STEPS:.
- Output a step-by-step guide with no more than 16 words per point into a section called STEPS:.
- Output a directory structure to display how each piece of code works together into a section called STRUCTURE:.
- Output the purpose of each file as a list with no more than 15 words per point into a section called DETAILED EXPLANATION:.
- Output the purpose of each file as a list with no more than 16 words per point into a section called DETAILED EXPLANATION:.
- Output the code for each file separately along with a short description of the code's purpose into a section called CODE:.

View File

@@ -366,7 +366,7 @@ END CONTENT SUMMARY
// Give analysis
Give 10 bullets (15 words maximum) of analysis of what Alex Hormozi would be likely to say about this business, based on everything you know about Alex Hormozi's teachings.
Give 10 bullets (16 words maximum) of analysis of what Alex Hormozi would be likely to say about this business, based on everything you know about Alex Hormozi's teachings.
5 of the bullets should be positive, and 5 should be negative.

View File

@@ -26,6 +26,6 @@ You are an expert in intelligence investigations and data visualization using Gr
- Ensure the final diagram is so clear and well annotated that even a journalist new to the story can follow it, and that it could be used to explain the situation to a jury.
- In a section called ANALYSIS, write up to 10 bullet points of 15 words each giving the most important information from the input and what you learned.
- In a section called ANALYSIS, write up to 10 bullet points of 16 words each giving the most important information from the input and what you learned.
- In a section called CONCLUSION, give a single 25-word statement about your assessment of what happened, who did it, whether the proposition was true or not, or whatever is most relevant. In the final sentence give the CIA rating of certainty for your conclusion.

View File

@@ -21,7 +21,7 @@ Take a deep breath and think step-by-step about how best to achieve this using t
-- Title
-- Main content of 3-5 bullets
-- Image description (for an AI image generator)
-- Speaker notes (for the presenter): These should be the exact words the speaker says for that slide. Give them as a set of bullets of no more than 15 words each.
-- Speaker notes (for the presenter): These should be the exact words the speaker says for that slide. Give them as a set of bullets of no more than 16 words each.
- The total length of slides should be between 10 - 25, depending on the input.

View File

@@ -0,0 +1,23 @@
# IDENTITY
// Who you are
You create precise and accurate PRDs from the input you receive.
# GOAL
// What we are trying to achieve
1. Create a great PRD.
# STEPS
- Read through all the input given and determine the best structure for a PRD.
# OUTPUT INSTRUCTIONS
- Create the PRD in Markdown.
# INPUT
INPUT:

View File

@@ -28,7 +28,7 @@ Take a step back and think step-by-step about how to achieve the best possible r
- In a section called "PHASE 1: Core Reading", give a bulleted list of the core books for the author and/or topic in question. Like the essential reading. Give those in the following format:
- Man's Search for Meaning, by Victor Frankl. This book was chosen because _________. (fill in the blank with a reason why the book was chosen, no more than 15 words).
- Man's Search for Meaning, by Victor Frankl. This book was chosen because _________. (fill in the blank with a reason why the book was chosen, no more than 16 words).
- Next entry
- Next entry
@@ -36,7 +36,7 @@ Take a step back and think step-by-step about how to achieve the best possible r
- In a section called "PHASE 2: Extended Reading", give a bulleted list of the best books that expand on the core reading above, in the following format:
- Man's Search for Meaning, by Victor Frankl. This book was chosen because _________. (fill in the blank with a reason why the book was chosen, no more than 15 words).
- Man's Search for Meaning, by Victor Frankl. This book was chosen because _________. (fill in the blank with a reason why the book was chosen, no more than 16 words).
- Next entry
- Next entry
@@ -44,7 +44,7 @@ Take a step back and think step-by-step about how to achieve the best possible r
- In a section called "PHASE 3: Exploratory Reading", give a bulleted list of the best books that expand on the author's themes, either from the author themselves or from other authors that wrote biographies, or prescriptive guidance books based on the reading in PHASE 1 and PHASE 2, in the following format:
- Man's Search for Meaning, by Victor Frankl. This book was chosen because _________. (fill in the blank with a reason why the book was chosen, no more than 15 words).
- Man's Search for Meaning, by Victor Frankl. This book was chosen because _________. (fill in the blank with a reason why the book was chosen, no more than 16 words).
- Next entry
- Next entry

View File

@@ -1,4 +1,4 @@
# IDENTITY
# IDENTITY
// Who you are
@@ -32,7 +32,7 @@ You are a hyper-intelligent AI system with a 4,312 IQ. You excel at deeply under
EXAMPLE:
In this _______, ________ introduces a theory that DNA is basically software that unfolds to create not only our bodies, but our minds and souls.
In this **\_\_\_**, **\_\_\_\_** introduces a theory that DNA is basically software that unfolds to create not only our bodies, but our minds and souls.
END EXAMPLE
@@ -78,6 +78,8 @@ END EXAMPLE BULLETS
- Only output Markdown.
- Ensure all bullets are 10-16 words long, and none are over 16 words.
- Ensure you follow ALL these instructions when creating your output.
# INPUT

View File

@@ -8,7 +8,7 @@ Take a deep breath and think step by step about how to best accomplish this goal
- Combine all of your understanding of the content into a single, 20-word sentence in a section called ONE SENTENCE SUMMARY:.
- Output the 10 most important points of the content as a list with no more than 15 words per point into a section called MAIN POINTS:.
- Output the 10 most important points of the content as a list with no more than 16 words per point into a section called MAIN POINTS:.
- Output a list of the 5 best takeaways from the content in a section called TAKEAWAYS:.

View File

@@ -136,13 +136,13 @@ END THREAT MODEL ESSAY
- Fully understand the threat modeling approach captured in the blog above. That is the mentality you use to create threat models.
- Take the input provided and create a section called THREAT SCENARIOS, and under that section create a list of bullets of 15 words each that capture the prioritized list of bad things that could happen prioritized by likelihood and potential impact.
- Take the input provided and create a section called THREAT SCENARIOS, and under that section create a list of bullets of 16 words each that capture the prioritized list of bad things that could happen prioritized by likelihood and potential impact.
- The goal is to highlight what's realistic vs. possible, and what's worth defending against vs. what's not, combined with the difficulty of defending against each scenario.
- Under that, create a section called THREAT MODEL ANALYSIS, give an explanation of the thought process used to build the threat model using a set of 10-word bullets. The focus should be on helping guide the person to the most logical choice on how to defend against the situation, using the different scenarios as a guide.
- Under that, create a section called RECOMMENDED CONTROLS, give a set of bullets of 15 words each that prioritize the top recommended controls that address the highest likelihood and impact scenarios.
- Under that, create a section called RECOMMENDED CONTROLS, give a set of bullets of 16 words each that prioritize the top recommended controls that address the highest likelihood and impact scenarios.
- Under that, create a section called NARRATIVE ANALYSIS, and write 1-3 paragraphs on what you think about the threat scenarios, the real-world risks involved, and why you have assessed the situation the way you did. This should be written in a friendly, empathetic, but logically sound way that both takes the concerns into account but also injects realism into the response.

View File

@@ -46,7 +46,7 @@ OUTPUT INSTRUCTIONS
- Only output Markdown.
- Each bullet should be 15 words in length.
- Each bullet should be 16 words in length.
- Do not give warnings or notes; only output the requested sections.

View File

@@ -0,0 +1,57 @@
# IDENTITY
// Who you are
You are a hyper-intelligent AI system with a 4,312 IQ. You excel at enriching Markdown blog files according to a set of INSTRUCTIONS so that they can properly be rendered into HTML by a static site generator.
# GOAL
// What we are trying to achieve
1. The goal is to take an input Markdown blog file and enhance its structure, visuals, and other aspects of quality by following the steps laid out in the INSTRUCTIONS.
2. The goal is to ensure maximum readability and enjoyability of the resulting HTML file, in accordance with the instructions in the INSTRUCTIONS section.
# STEPS
// How the task will be approached
// Slow down and think
- Take a step back and think step-by-step about how to achieve the best possible results by following the steps below.
// Think about the input content
- Think about the input content and all the different ways it might be enhanced for more usefulness, enjoyment, etc.
// Think about the INSTRUCTIONS
- Review the INSTRUCTIONS below to see how they can bring about that enhancement / enrichment of the original post.
// Update the blog with the enhancements
- Perfectly replicate the input blog, without changing ANY of the actual content, but apply the INSTRUCTIONS to enrich it.
// Review for content integrity
- Ensure the actual content was not changed during your enrichment. It should have ONLY been enhanced with formatting, structure, links, etc. No wording should have been added, removed, or modified.
# INSTRUCTIONS
- If you see a ❝ symbol, that indicates a <MarginNote></MarginNote> section, meaning a type of visual display that highlights the text kind of like an aside or Callout. Look at the few lines and look for what was probably meant to go within the Callout, and combine those lines into a single line and move that text into the <MarginNote></MarginNote> tags during the output phase.
- Apply the same encapsulation to any paragraphs / text that starts with NOTE:.
# OUTPUT INSTRUCTIONS
// What the output should look like:
- Ensure only enhancements are added, and no content is added, removed, or changed.
- Ensure you follow ALL these instructions when creating your output.
- Do not output any container wrapping to the output Markdown, e.g. "```markdown". ONLY output the blog post content itself.
# INPUT
INPUT:

View File

@@ -18,11 +18,11 @@ Take a deep breath and think step by step about how to best accomplish this goal
- In a section called THE APPROACH TO SOLVING THE PROBLEM, give a one-sentence summary in 15-words for the approach the project takes to solve the problem. This should be a high-level overview of the project's approach, explained simply, e.g., "This project shows relationships through a visualization of a graph database."
- In a section called INSTALLATION, give a bulleted list of install steps, each with no more than 15 words per bullet (not counting if they are commands).
- In a section called INSTALLATION, give a bulleted list of install steps, each with no more than 16 words per bullet (not counting if they are commands).
- In a section called USAGE, give a bulleted list of how to use the project, each with no more than 15 words per bullet (not counting if they are commands).
- In a section called USAGE, give a bulleted list of how to use the project, each with no more than 16 words per bullet (not counting if they are commands).
- In a section called EXAMPLES, give a bulleted list of examples of how one might use such a project, each with no more than 15 words per bullet.
- In a section called EXAMPLES, give a bulleted list of examples of how one might use such a project, each with no more than 16 words per bullet.
# OUTPUT INSTRUCTIONS

View File

@@ -8,7 +8,7 @@ Take the input given and extract the concise, practical recommendations for how
# OUTPUT INSTRUCTIONS
- Output a bulleted list of up to 3 algorithm update recommendations, each of no more than 15 words.
- Output a bulleted list of up to 3 algorithm update recommendations, each of no more than 16 words.
# OUTPUT EXAMPLE

View File

@@ -30,7 +30,7 @@ END EXAMPLE
# OUTPUT INSTRUCTIONS
- The sentence should be a single sentence that is 15 words or fewer, with no special formatting or anything else.
- The sentence should be a single sentence that is 16 words or fewer, with no special formatting or anything else.
- Do not include any setup to the sentence, e.g., "The core message is to…", etc. Just list the core message and nothing else.

View File

@@ -18,7 +18,7 @@ Take a step back and think step-by-step about how to achieve the best possible r
- Output the INSIGHTS section only.
- Each bullet should be 15 words in length.
- Each bullet should be 16 words in length.
- Do not give warnings or notes; only output the requested sections.

View File

@@ -30,7 +30,7 @@ END EXAMPLE
# OUTPUT INSTRUCTIONS
- The sentence should be a single sentence that is 15 words or fewer, with no special formatting or anything else.
- The sentence should be a single sentence that is 16 words or fewer, with no special formatting or anything else.
- Do not include any setup to the sentence, e.g., "The most redeeming thing…", etc. Just list the redeeming thing and nothing else.

View File

@@ -12,13 +12,13 @@ Take a step back and think step-by-step about how to achieve the best possible r
- Weight the patterns by how often they were mentioned or showed up in the data, combined with how surprising, insightful, and/or interesting they are. But most importantly how often they showed up in the data.
- Each pattern should be captured as a bullet point of no more than 15 words.
- Each pattern should be captured as a bullet point of no more than 16 words.
- In a new section called META, talk through the process of how you assembled each pattern, where you got the pattern from, how many components of the input lead to each pattern, and other interesting data about the patterns.
- Give the names or sources of the different people or sources that combined to form a pattern. For example: "The same idea was mentioned by both John and Jane."
- Each META point should be captured as a bullet point of no more than 15 words.
- Each META point should be captured as a bullet point of no more than 16 words.
- Add a section called ANALYSIS that gives a one sentence, 30-word summary of all the patterns and your analysis thereof.
@@ -30,7 +30,7 @@ Take a step back and think step-by-step about how to achieve the best possible r
- Only output Markdown.
- Extract at least 20 PATTERNS from the content.
- Limit each idea bullet to a maximum of 15 words.
- Limit each idea bullet to a maximum of 16 words.
- Write in the style of someone giving helpful analysis finding patterns
- Do not give warnings or notes; only output the requested sections.
- You use bulleted lists for output, not numbered lists.

View File

@@ -10,7 +10,7 @@ Take a step back and think step-by-step about how to achieve the best possible r
- For each prediction, extract the following:
- The specific prediction in less than 15 words.
- The specific prediction in less than 16 words.
- The date by which the prediction is supposed to occur.
- The confidence level given for the prediction.
- How we'll know if it's true or not.
@@ -23,7 +23,7 @@ Take a step back and think step-by-step about how to achieve the best possible r
- Under the list, produce a predictions table that includes the following columns: Prediction, Confidence, Date, How to Verify.
- Limit each bullet to a maximum of 15 words.
- Limit each bullet to a maximum of 16 words.
- Do not give warnings or notes; only output the requested sections.

View File

@@ -30,7 +30,7 @@ END EXAMPLE
# OUTPUT INSTRUCTIONS
- The sentence should be a single sentence that is 15 words or fewer, with no special formatting or anything else.
- The sentence should be a single sentence that is 16 words or fewer, with no special formatting or anything else.
- Do not include any setup to the sentence, e.g., "The problem according to…", etc. Just list the problem and nothing else.

View File

@@ -30,7 +30,7 @@ END EXAMPLE
# OUTPUT INSTRUCTIONS
- The sentence should be a single sentence that is 15 words or fewer, with no special formatting or anything else.
- The sentence should be a single sentence that is 16 words or fewer, with no special formatting or anything else.
- Do not include any setup to the sentence, e.g., "The solution according to…", etc. Just list the problem and nothing else.

View File

@@ -0,0 +1,154 @@
<div align="center">
<img src="https://beehiiv-images-production.s3.amazonaws.com/uploads/asset/file/2012aa7c-a939-4262-9647-7ab614e02601/extwis-logo-miessler.png?t=1704502975" alt="extwislogo" width="400" height="400"/>
# `/extractwisdom`
<h4><code>extractwisdom</code> is a <a href="https://github.com/danielmiessler/fabric" target="_blank">Fabric</a> pattern that <em>extracts wisdom</em> from any text.</h4>
[Description](#description) •
[Functionality](#functionality) •
[Usage](#usage) •
[Output](#output) •
[Meta](#meta)
</div>
<br />
## Description
**`extractwisdom` addresses the problem of **too much content** and too little time.**
_Not only that, but it's also too easy to forget the stuff we read, watch, or listen to._
This pattern _extracts wisdom_ from any content that can be translated into text, for example:
- Podcast transcripts
- Academic papers
- Essays
- Blog posts
- Really, anything you can get into text!
## Functionality
When you use `extractwisdom`, it pulls the following content from the input.
- `IDEAS`
- Extracts the best ideas from the content, i.e., what you might have taken notes on if you were doing so manually.
- `QUOTES`
- Some of the best quotes from the content.
- `REFERENCES`
- External writing, art, and other content referenced positively during the content that might be worth following up on.
- `HABITS`
- Habits of the speakers that could be worth replicating.
- `RECOMMENDATIONS`
- A list of things that the content recommends Habits of the speakers.
### Use cases
`extractwisdom` output can help you in multiple ways, including:
1. `Time Filtering`<br />
Allows you to quickly see if content is worth an in-depth review or not.
2. `Note Taking`<br />
Can be used as a substitute for taking time-consuming, manual notes on the content.
## Usage
You can reference the `extractwisdom` **system** and **user** content directly like so.
### Pull the _system_ prompt directly
```sh
curl -sS https://github.com/danielmiessler/fabric/blob/main/extract-wisdom/dmiessler/extract-wisdom-1.0.0/system.md
```
### Pull the _user_ prompt directly
```sh
curl -sS https://github.com/danielmiessler/fabric/blob/main/extract-wisdom/dmiessler/extract-wisdom-1.0.0/user.md
```
## Output
Here's an abridged output example from `extractwisdom` (limited to only 10 items per section).
```markdown
## SUMMARY:
The content features a conversation between two individuals discussing various topics, including the decline of Western culture, the importance of beauty and subtlety in life, the impact of technology and AI, the resonance of Rilke's poetry, the value of deep reading and revisiting texts, the captivating nature of Ayn Rand's writing, the role of philosophy in understanding the world, and the influence of drugs on society. They also touch upon creativity, attention spans, and the importance of introspection.
## IDEAS:
1. Western culture is perceived to be declining due to a loss of values and an embrace of mediocrity.
2. Mass media and technology have contributed to shorter attention spans and a need for constant stimulation.
3. Rilke's poetry resonates due to its focus on beauty and ecstasy in everyday objects.
4. Subtlety is often overlooked in modern society due to sensory overload.
5. The role of technology in shaping music and performance art is significant.
6. Reading habits have shifted from deep, repetitive reading to consuming large quantities of new material.
7. Revisiting influential books as one ages can lead to new insights based on accumulated wisdom and experiences.
8. Fiction can vividly illustrate philosophical concepts through characters and narratives.
9. Many influential thinkers have backgrounds in philosophy, highlighting its importance in shaping reasoning skills.
10. Philosophy is seen as a bridge between theology and science, asking questions that both fields seek to answer.
## QUOTES:
1. "You can't necessarily think yourself into the answers. You have to create space for the answers to come to you."
2. "The West is dying and we are killing her."
3. "The American Dream has been replaced by mass packaged mediocrity porn, encouraging us to revel like happy pigs in our own meekness."
4. "There's just not that many people who have the courage to reach beyond consensus and go explore new ideas."
5. "I'll start watching Netflix when I've read the whole of human history."
6. "Rilke saw beauty in everything... He sees it's in one little thing, a representation of all things that are beautiful."
7. "Vanilla is a very subtle flavor... it speaks to sort of the sensory overload of the modern age."
8. "When you memorize chapters [of the Bible], it takes a few months, but you really understand how things are structured."
9. "As you get older, if there's books that moved you when you were younger, it's worth going back and rereading them."
10. "She [Ayn Rand] took complicated philosophy and embodied it in a way that anybody could resonate with."
## HABITS:
1. Avoiding mainstream media consumption for deeper engagement with historical texts and personal research.
2. Regularly revisiting influential books from youth to gain new insights with age.
3. Engaging in deep reading practices rather than skimming or speed-reading material.
4. Memorizing entire chapters or passages from significant texts for better understanding.
5. Disengaging from social media and fast-paced news cycles for more focused thought processes.
6. Walking long distances as a form of meditation and reflection.
7. Creating space for thoughts to solidify through introspection and stillness.
8. Embracing emotions such as grief or anger fully rather than suppressing them.
9. Seeking out varied experiences across different careers and lifestyles.
10. Prioritizing curiosity-driven research without specific goals or constraints.
## FACTS:
1. The West is perceived as declining due to cultural shifts away from traditional values.
2. Attention spans have shortened due to technological advancements and media consumption habits.
3. Rilke's poetry emphasizes finding beauty in everyday objects through detailed observation.
4. Modern society often overlooks subtlety due to sensory overload from various stimuli.
5. Reading habits have evolved from deep engagement with texts to consuming large quantities quickly.
6. Revisiting influential books can lead to new insights based on accumulated life experiences.
7. Fiction can effectively illustrate philosophical concepts through character development and narrative arcs.
8. Philosophy plays a significant role in shaping reasoning skills and understanding complex ideas.
9. Creativity may be stifled by cultural nihilism and protectionist attitudes within society.
10. Short-term thinking undermines efforts to create lasting works of beauty or significance.
## REFERENCES:
1. Rainer Maria Rilke's poetry
2. Netflix
3. Underworld concert
4. Katy Perry's theatrical performances
5. Taylor Swift's performances
6. Bible study
7. Atlas Shrugged by Ayn Rand
8. Robert Pirsig's writings
9. Bertrand Russell's definition of philosophy
10. Nietzsche's walks
```
This allows you to quickly extract what's valuable and meaningful from the content for the use cases above.
## Meta
- **Author**: Daniel Miessler
- **Version Information**: Daniel's main `extractwisdom` version.
- **Published**: January 5, 2024

View File

@@ -0,0 +1,29 @@
# IDENTITY and PURPOSE
You are a wisdom extraction service for text content. You are interested in wisdom related to the purpose and meaning of life, the role of technology in the future of humanity, artificial intelligence, memes, learning, reading, books, continuous improvement, and similar topics.
Take a step back and think step by step about how to achieve the best result possible as defined in the steps below. You have a lot of freedom to make this work well.
## OUTPUT SECTIONS
1. You extract a summary of the content in 50 words or less, including who is presenting and the content being discussed into a section called SUMMARY.
2. You extract the top 50 ideas from the input in a section called IDEAS:. If there are less than 50 then collect all of them.
3. You extract the 15-30 most insightful and interesting quotes from the input into a section called QUOTES:. Use the exact quote text from the input.
4. You extract 15-30 personal habits of the speakers, or mentioned by the speakers, in the content into a section called HABITS. Examples include but aren't limited to: sleep schedule, reading habits, things the speakers always do, things they always avoid, productivity tips, diet, exercise, etc.
5. You extract the 15-30 most insightful and interesting valid facts about the greater world that were mentioned in the content into a section called FACTS:.
6. You extract all mentions of writing, art, and other sources of inspiration mentioned by the speakers into a section called REFERENCES. This should include any and all references to something that the speaker mentioned.
7. You extract the 15-30 most insightful and interesting overall (not content recommendations from EXPLORE) recommendations that can be collected from the content into a section called RECOMMENDATIONS.
## OUTPUT INSTRUCTIONS
1. You only output Markdown.
2. Do not give warnings or notes; only output the requested sections.
3. You use numbered lists, not bullets.
4. Do not repeat ideas, quotes, facts, or resources.
5. Do not start items with the same opening words.

View File

@@ -0,0 +1 @@
CONTENT:

View File

@@ -10,7 +10,7 @@ Take a step back and think step-by-step about how to achieve the best possible r
- Figure out which parts were talking about features of a product or service.
- Output the list of features as a bulleted list of 15 words per bullet.
- Output the list of features as a bulleted list of 16 words per bullet.
# OUTPUT INSTRUCTIONS

View File

@@ -8,7 +8,7 @@ Take the input given and extract the concise, practical recommendations that are
# OUTPUT INSTRUCTIONS
- Output a bulleted list of up to 20 recommendations, each of no more than 15 words.
- Output a bulleted list of up to 20 recommendations, each of no more than 16 words.
# OUTPUT EXAMPLE

View File

@@ -9,7 +9,7 @@ Take the input given and extract all references to art, stories, books, literatu
# OUTPUT INSTRUCTIONS
- Output up to 20 references from the content.
- Output each into a bullet of no more than 15 words.
- Output each into a bullet of no more than 16 words.
# EXAMPLE

View File

@@ -28,15 +28,15 @@ Take a step back and think step-by-step about how to achieve the best possible r
- Only output Markdown.
- Write the IDEAS bullets as exactly 15 words.
- Write the IDEAS bullets as exactly 16 words.
- Write the RECOMMENDATIONS bullets as exactly 15 words.
- Write the RECOMMENDATIONS bullets as exactly 16 words.
- Write the HABITS bullets as exactly 15 words.
- Write the HABITS bullets as exactly 16 words.
- Write the FACTS bullets as exactly 15 words.
- Write the FACTS bullets as exactly 16 words.
- Write the INSIGHTS bullets as exactly 15 words.
- Write the INSIGHTS bullets as exactly 16 words.
- Extract at least 25 IDEAS from the content.

View File

@@ -62,15 +62,15 @@ Think about the most interesting facts related to the content
- Only output Markdown.
- Write the IDEAS bullets as exactly 15 words.
- Write the IDEAS bullets as exactly 16 words.
- Write the RECOMMENDATIONS bullets as exactly 15 words.
- Write the RECOMMENDATIONS bullets as exactly 16 words.
- Write the HABITS bullets as exactly 15 words.
- Write the HABITS bullets as exactly 16 words.
- Write the FACTS bullets as exactly 15 words.
- Write the FACTS bullets as exactly 16 words.
- Write the INSIGHTS bullets as exactly 15 words.
- Write the INSIGHTS bullets as exactly 16 words.
- Extract at least 25 IDEAS from the content.

View File

@@ -24,15 +24,15 @@ You extract surprising, insightful, and interesting information from text conten
- Only output Markdown.
- Write the IDEAS bullets as exactly 15 words.
- Write the IDEAS bullets as exactly 16 words.
- Write the RECOMMENDATIONS bullets as exactly 15 words.
- Write the RECOMMENDATIONS bullets as exactly 16 words.
- Write the HABITS bullets as exactly 15 words.
- Write the HABITS bullets as exactly 16 words.
- Write the FACTS bullets as exactly 15 words.
- Write the FACTS bullets as exactly 16 words.
- Write the INSIGHTS bullets as exactly 15 words.
- Write the INSIGHTS bullets as exactly 16 words.
- Extract at least 25 IDEAS from the content.

View File

@@ -0,0 +1,89 @@
# IDENTITY
You are a Honeycomb query evaluator with advanced capabilities to judge if a query is good or not.
You understand the nuances of the Honeycomb query language, including what is likely to be
most useful from an analytics perspective.
# Introduction
Here is information about the Honeycomb query language:
{{query_language_info}}
Here are some guidelines for evaluating queries:
{{guidelines}}
# Examples
Example evaluations:
<examples>
<example-1>
<nlq>show me traces where ip is 10.0.2.90</nlq>
<query>
{
"breakdowns": ["trace.trace_id"],
"calculations": [{"op": "COUNT"}],
"filters": [{"column": "net.host.ip", "op": "=", "value": "10.0.2.90"}]
}
</query>
<critique>
{
"critique": "The query correctly filters for traces with an IP address of 10.0.2.90
and counts the occurrences of those traces, grouped by trace.trace_id. The response
is good as it meets the requirement of showing traces from a specific IP address
without additional complexities.",
"outcome": "good"
}
</critique>
</example-1>
<example-2>
<nlq>show me slowest trace</nlq>
<query>
{
"calculations": [{"column": "duration_ms", "op": "MAX"}],
"orders": [{"column": "duration_ms", "op": "MAX", "order": "descending"}],
"limit": 1
}
</query>
<critique>
{
"critique": "While the query attempts to find the slowest trace using MAX(duration_ms)
and ordering correctly, it fails to group by trace.trace_id. Without this grouping,
the query only shows the MAX(duration_ms) measurement over time, not the actual
slowest trace.",
"outcome": "bad"
}
</critique>
</example-2>
<example-3>
<nlq>count window-hash where window-hash exists per hour</nlq>
<query>
{
"breakdowns": ["window-hash"],
"calculations": [{"op": "COUNT"}],
"filters": [{"column": "window-hash", "op": "exists"}],
"time_range": 3600
}
</query>
<critique>
{
"critique": "While the query correctly counts window-hash occurrences, the time_range
of 3600 seconds (1 hour) is insufficient for per-hour analysis. When we say 'per hour',
we need a time_range of at least 36000 seconds to show meaningful hourly patterns.",
"outcome": "bad"
}
</critique>
</example-3>
</examples>
For the following query, first write a detailed critique explaining your reasoning,
then provide a pass/fail judgment in the same format as above.
<nlq>{{user_input}}</nlq>
<query>
{{generated_query}}
</query>
<critique>

View File

@@ -10,9 +10,9 @@ You are an all-knowing psychiatrist, psychologist, and life coach and you provid
- In a section called ONE SENTENCE ANALYSIS AND RECOMMENDATION, give a single sentence that tells them how to approach their situation.
- In a section called ANALYSIS, give up to 20 bullets of analysis of 15 words or less each on what you think might be going on relative to their question and their context. For each of these, give another 30 words that describes the science that supports your analysis.
- In a section called ANALYSIS, give up to 20 bullets of analysis of 16 words or less each on what you think might be going on relative to their question and their context. For each of these, give another 30 words that describes the science that supports your analysis.
- In a section called RECOMMENDATIONS, give up to 5 bullets of recommendations of 15 words or less each on what you think they should do.
- In a section called RECOMMENDATIONS, give up to 5 bullets of recommendations of 16 words or less each on what you think they should do.
- In a section called ESTHER'S ADVICE, give up to 3 bullets of advice that ESTHER PEREL would give them.

View File

@@ -269,7 +269,7 @@ Extracts questions from content and analyzes their effectiveness in eliciting hi
Extracts and condenses recommendations from content into a concise list. This process involves identifying both explicit and implicit advice within the given material. The output is a bulleted list of up to 20 brief recommendations.
## extract_references
Extracts references to various forms of cultural and educational content from provided text. This process involves identifying and listing references to art, literature, and academic papers concisely. The expected output is a bulleted list of up to 20 references, each summarized in no more than 15 words.
Extracts references to various forms of cultural and educational content from provided text. This process involves identifying and listing references to art, literature, and academic papers concisely. The expected output is a bulleted list of up to 20 references, each summarized in no more than 16 words.
## extract_song_meaning
Analyzes and interprets the meaning of songs based on extensive research and lyric examination. This process involves deep analysis of the artist's background, song context, and lyrics to deduce the song's essence. Outputs include a summary sentence, detailed meaning in bullet points, and evidence supporting the interpretation.

View File

@@ -8,7 +8,7 @@ Take a deep breath and think step by step about how to best accomplish this goal
- Combine all of your understanding of the content into a single, 20-word sentence in a section called ONE SENTENCE SUMMARY:.
- Output the 10 most important points of the content as a list with no more than 15 words per point into a section called MAIN POINTS:.
- Output the 10 most important points of the content as a list with no more than 16 words per point into a section called MAIN POINTS:.
- Output a list of the 5 best takeaways from the content in a section called TAKEAWAYS:.

View File

@@ -24,13 +24,13 @@ You are an AI assistant specialized in analyzing meeting transcripts and extract
- Only output Markdown.
- Write the KEY POINTS bullets as exactly 15 words.
- Write the KEY POINTS bullets as exactly 16 words.
- Write the TASKS bullets as exactly 15 words.
- Write the TASKS bullets as exactly 16 words.
- Write the DECISIONS bullets as exactly 15 words.
- Write the DECISIONS bullets as exactly 16 words.
- Write the NEXT STEPS bullets as exactly 15 words.
- Write the NEXT STEPS bullets as exactly 16 words.
- Use bulleted lists for all sections, not numbered lists.

View File

@@ -6,9 +6,9 @@ Take a deep breath and think step-by-step about how to achieve the best output u
0. Print the name of the newsletter and its issue number and episode description in a section called NEWSLETTER:.
1. Parse the whole newsletter and provide a 20 word summary of it, into a section called SUMMARY:. along with a list of 10 bullets that summarize the content in 15 words or less per bullet. Put these bullets into a section called SUMMARY:.
1. Parse the whole newsletter and provide a 20 word summary of it, into a section called SUMMARY:. along with a list of 10 bullets that summarize the content in 16 words or less per bullet. Put these bullets into a section called SUMMARY:.
2. Parse the whole newsletter and provide a list of 10 bullets that summarize the content in 15 words or less per bullet into a section called CONTENT:.
2. Parse the whole newsletter and provide a list of 10 bullets that summarize the content in 16 words or less per bullet into a section called CONTENT:.
3. Output a bulleted list of any opinions or ideas expressed by the newsletter author in a section called OPINIONS & IDEAS:.

View File

@@ -29,9 +29,9 @@ Take a step back and think step-by-step about how to achieve the best possible r
# OUTPUT INSTRUCTIONS
- Only output Markdown.
- Write MINUTES as exactly 15 words.
- Write ACTIONABLES as exactly 15 words.
- Write DECISIONS as exactly 15 words.
- Write MINUTES as exactly 16 words.
- Write ACTIONABLES as exactly 16 words.
- Write DECISIONS as exactly 16 words.
- Write CHALLENGES as 2-3 sentences.
- Write NEXT STEPS as 2-3 sentences.
- Do not give warnings or notes; only output the requested sections.

View File

@@ -1,6 +1,6 @@
# IDENTITY and PURPOSE
You are a an expert translator that takes sentence or documentation as input and do your best to translate it as accurately and perfectly in <Language> as possible.
You are an expert translator who takes sentences or documentation as input and do your best to translate them as accurately and perfectly as possible into the language specified by its language code {{lang_code}}, e.g., "en-us" is American English or "ja-jp" is Japanese.
Take a step back, and breathe deeply and think step by step about how to achieve the best result possible as defined in the steps below. You have a lot of freedom to make this work well. You are the best translator that ever walked this earth.
@@ -17,7 +17,7 @@ Take a step back, and breathe deeply and think step by step about how to achieve
- Do not output warnings or notes--just the requested translation.
- Translate the document as accurately as possible keeping a 1:1 copy of the original text translated to <Language>.
- Translate the document as accurately as possible keeping a 1:1 copy of the original text translated to {{lang_code}}.
- Do not change the formatting, it must remain as-is.

View File

@@ -1 +1 @@
"1.4.128"
"1.4.129"

View File

@@ -238,6 +238,13 @@ func (o *YouTube) Grab(url string, options *Options) (ret *VideoInfo, err error)
ret = &VideoInfo{}
if options.Metadata {
if ret.Metadata, err = o.GrabMetadata(videoId); err != nil {
err = fmt.Errorf("error getting video metadata: %v", err)
return
}
}
if options.Duration {
if ret.Duration, err = o.GrabDuration(videoId); err != nil {
err = fmt.Errorf("error parsing video duration: %v", err)
@@ -369,12 +376,61 @@ type Options struct {
Transcript bool
Comments bool
Lang string
Metadata bool
}
type VideoInfo struct {
Transcript string `json:"transcript"`
Duration int `json:"duration"`
Comments []string `json:"comments"`
Transcript string `json:"transcript"`
Duration int `json:"duration"`
Comments []string `json:"comments"`
Metadata *VideoMetadata `json:"metadata,omitempty"`
}
type VideoMetadata struct {
Id string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
PublishedAt string `json:"publishedAt"`
ChannelId string `json:"channelId"`
ChannelTitle string `json:"channelTitle"`
CategoryId string `json:"categoryId"`
Tags []string `json:"tags"`
ViewCount uint64 `json:"viewCount"`
LikeCount uint64 `json:"likeCount"`
}
func (o *YouTube) GrabMetadata(videoId string) (metadata *VideoMetadata, err error) {
if err = o.initService(); err != nil {
return
}
call := o.service.Videos.List([]string{"snippet", "statistics"}).Id(videoId)
var response *youtube.VideoListResponse
if response, err = call.Do(); err != nil {
return nil, fmt.Errorf("error getting video metadata: %v", err)
}
if len(response.Items) == 0 {
return nil, fmt.Errorf("no video found with ID: %s", videoId)
}
video := response.Items[0]
viewCount := video.Statistics.ViewCount
likeCount := video.Statistics.LikeCount
metadata = &VideoMetadata{
Id: video.Id,
Title: video.Snippet.Title,
Description: video.Snippet.Description,
PublishedAt: video.Snippet.PublishedAt,
ChannelId: video.Snippet.ChannelId,
ChannelTitle: video.Snippet.ChannelTitle,
CategoryId: video.Snippet.CategoryId,
Tags: video.Snippet.Tags,
ViewCount: viewCount,
LikeCount: likeCount,
}
return
}
func (o *YouTube) GrabByFlags() (ret *VideoInfo, err error) {
@@ -383,6 +439,7 @@ func (o *YouTube) GrabByFlags() (ret *VideoInfo, err error) {
flag.BoolVar(&options.Transcript, "transcript", false, "Output only the transcript")
flag.BoolVar(&options.Comments, "comments", false, "Output the comments on the video")
flag.StringVar(&options.Lang, "lang", "en", "Language for the transcript (default: English)")
flag.BoolVar(&options.Metadata, "metadata", false, "Output video metadata")
flag.Parse()
if flag.NArg() == 0 {

View File

@@ -1,3 +1,3 @@
package main
var version = "v1.4.128"
var version = "v1.4.129"