Repository: twindle-co/twindle
Branch: main
Commit: 489403a8c761
Files: 416
Total size: 729.3 KB
Directory structure:
gitextract_rvcqqkjj/
├── .all-contributorsrc
├── .github/
│ ├── PULL_REQUEST_TEMPLATE.md
│ ├── TEMP_ISSUE_TEMPLATE.md
│ └── workflows/
│ ├── conflict.yml
│ ├── stale.yml
│ └── tests.yml
├── .gitignore
├── CNAME
├── LICENSE
├── README.md
├── misc/
│ ├── CONTRIBUTING.md
│ ├── docs/
│ │ ├── CHEATSHEET.md
│ │ ├── CODE-REVIEW-CHECKLIST.md
│ │ ├── FAQ.md
│ │ ├── NAMING-CONVENTIONS.md
│ │ ├── ONBOARDING.md
│ │ ├── README.md
│ │ ├── RESOURCES.md
│ │ ├── TEAM.md
│ │ ├── TWINDLE.md
│ │ ├── TWITTER.md
│ │ ├── articles/
│ │ │ ├── Process-for-new-contributors.md
│ │ │ ├── README.md
│ │ │ ├── creating-first-pull-request.md
│ │ │ ├── design-guide-for-good-logo.md
│ │ │ ├── git -github-related.md
│ │ │ ├── handlebar-explained.md
│ │ │ ├── javascript-code.md
│ │ │ ├── pr-clean-commits.md
│ │ │ ├── puppeteer-explained.md
│ │ │ ├── setup-prettier-vscode.md
│ │ │ ├── solving-forked-commit-ahead.md
│ │ │ ├── sync-to-main-repo-using-git-bash.md
│ │ │ ├── sync-to-main-repo-using-pull-request.md
│ │ │ └── sync-to-main-repo.md
│ │ └── images/
│ │ └── README.md
│ ├── firstpr/
│ │ ├── abdu_masoudi.md
│ │ ├── abhilash_s_s.md
│ │ ├── ad3rinto.md
│ │ ├── adewale.md
│ │ ├── aditya.md
│ │ ├── aditya20233.md
│ │ ├── aditya786.md
│ │ ├── akshay.md
│ │ ├── alejandra_pinto.md
│ │ ├── alexis.md
│ │ ├── ali.md
│ │ ├── andrei.md
│ │ ├── anujshukla.md
│ │ ├── aparna.md
│ │ ├── aravind.md
│ │ ├── arthurbuhl.md
│ │ ├── ashish.md
│ │ ├── baijanath.md
│ │ ├── bill.md
│ │ ├── blessing.md
│ │ ├── can.md
│ │ ├── chimdie.md
│ │ ├── codekumar.md
│ │ ├── daniel.md
│ │ ├── davabalan.md
│ │ ├── deepak.md
│ │ ├── deepak1_try2.md
│ │ ├── edori.md
│ │ ├── edwin.md
│ │ ├── eyram.md
│ │ ├── fabio.md
│ │ ├── franklinulrich.md
│ │ ├── fusen.md
│ │ ├── habeeb.md
│ │ ├── harsha.md
│ │ ├── ibrahim.md
│ │ ├── jahid.md
│ │ ├── jaki.md
│ │ ├── jesulayomi.md
│ │ ├── jilva.md
│ │ ├── joel_vinay_kumar.md
│ │ ├── karan.md
│ │ ├── karan_khosla.md
│ │ ├── kenny.md
│ │ ├── kingsley_victor.md
│ │ ├── kiran_don.md
│ │ ├── krishnadevz.md
│ │ ├── krypton.md
│ │ ├── lara_noomene.md
│ │ ├── layomi.md
│ │ ├── lilfatfrank.md
│ │ ├── liviza.md
│ │ ├── lorennale.md
│ │ ├── lukmanokunade.md
│ │ ├── luli.md
│ │ ├── manohar.md
│ │ ├── manuel_alejandro.md
│ │ ├── marcus.md
│ │ ├── maria_rivera.md
│ │ ├── mbui.md
│ │ ├── melissa_huerta.md
│ │ ├── michael.md
│ │ ├── mumbi.md
│ │ ├── nahuel.md
│ │ ├── nailah.md
│ │ ├── naveen.md
│ │ ├── neaz_mahmood.md
│ │ ├── nishank.md
│ │ ├── nitin_kadam.md
│ │ ├── nivetha.md
│ │ ├── omolo.md
│ │ ├── paniagua.md
│ │ ├── pavan.md
│ │ ├── pr_m.md
│ │ ├── prajwal.md
│ │ ├── pranav.md
│ │ ├── prasanna.md
│ │ ├── praveen.md
│ │ ├── pravin.md
│ │ ├── predrag_stamenkovic.md
│ │ ├── prem.md
│ │ ├── proful.md
│ │ ├── puru.md
│ │ ├── rafael.md
│ │ ├── rajesh_prajapati.md
│ │ ├── rakesh.md
│ │ ├── rohitsawai.md
│ │ ├── sachin.md
│ │ ├── samriddhi.md
│ │ ├── samueladeniyi.md
│ │ ├── sarvesh.md
│ │ ├── sasmita.md
│ │ ├── satyaki.md
│ │ ├── saurabh_srivastava.md
│ │ ├── scott.md
│ │ ├── sheetal.md
│ │ ├── shekharranjan.md
│ │ ├── simrin_joshi.md
│ │ ├── sippeybro.md
│ │ ├── sravan.md
│ │ ├── sunny.md
│ │ ├── suraj.md
│ │ ├── swatirao.md
│ │ ├── teckiegeek.md
│ │ ├── therealjimoh.md
│ │ ├── titi_olopade.md
│ │ ├── tolga.md
│ │ ├── trombley.md
│ │ ├── tushar.md
│ │ ├── tusharkandpal.md
│ │ ├── varad.md
│ │ ├── vera_nkanmuo.md
│ │ ├── vijaya.md
│ │ ├── vipin.md
│ │ ├── viraj_patil.md
│ │ ├── wamuyuwanjohi
│ │ └── yash.md
│ ├── playground/
│ │ ├── cli/
│ │ │ ├── README.md
│ │ │ └── spike/
│ │ │ ├── HackerNews/
│ │ │ │ ├── code.js
│ │ │ │ ├── code2.js
│ │ │ │ ├── mainindex.js
│ │ │ │ └── renderer/
│ │ │ │ ├── index.js
│ │ │ │ ├── pdf/
│ │ │ │ │ ├── createpdf.js
│ │ │ │ │ └── index.js
│ │ │ │ ├── render-template.js
│ │ │ │ └── template/
│ │ │ │ └── template.hbs
│ │ │ ├── README.md
│ │ │ ├── cli-epub/
│ │ │ │ ├── .gitignore
│ │ │ │ ├── epub.js
│ │ │ │ ├── index.js
│ │ │ │ ├── package.json
│ │ │ │ └── readme.md
│ │ │ ├── cli-example-esm/
│ │ │ │ ├── .gitignore
│ │ │ │ ├── index.js
│ │ │ │ ├── package.json
│ │ │ │ └── readme.md
│ │ │ ├── json-to-pdf-cli/
│ │ │ │ ├── Readme.md
│ │ │ │ ├── output.css
│ │ │ │ ├── output.html
│ │ │ │ ├── package.json
│ │ │ │ ├── script.js
│ │ │ │ ├── tweet_template.mustache
│ │ │ │ └── twit_thread.json
│ │ │ ├── markdown/
│ │ │ │ └── index.js
│ │ │ ├── pdf-from-html-cli/
│ │ │ │ ├── README.md
│ │ │ │ ├── create-pdf.js
│ │ │ │ ├── examples/
│ │ │ │ │ └── Twindle.html
│ │ │ │ ├── index.js
│ │ │ │ ├── package.json
│ │ │ │ ├── render-template.js
│ │ │ │ └── templates/
│ │ │ │ └── Thread.hbs
│ │ │ ├── pdf-from-json/
│ │ │ │ ├── Readme.md
│ │ │ │ ├── index.js
│ │ │ │ └── package.json
│ │ │ ├── phase2-server/
│ │ │ │ ├── api/
│ │ │ │ │ └── index.js
│ │ │ │ ├── config/
│ │ │ │ │ └── index.js
│ │ │ │ ├── environment.js
│ │ │ │ ├── index.js
│ │ │ │ ├── middlewares/
│ │ │ │ │ ├── index.js
│ │ │ │ │ ├── request-logger.js
│ │ │ │ │ └── twitter.js
│ │ │ │ ├── package.json
│ │ │ │ └── router/
│ │ │ │ ├── api/
│ │ │ │ │ └── index.js
│ │ │ │ ├── index.js
│ │ │ │ └── pages/
│ │ │ │ └── index.js
│ │ │ ├── simple-pdf-to-json/
│ │ │ │ ├── README.md
│ │ │ │ ├── json2pdf.html
│ │ │ │ ├── json2pdf.js
│ │ │ │ └── simple-pdf-to-json/
│ │ │ │ ├── newjson2pdf.css
│ │ │ │ ├── newjson2pdf.html
│ │ │ │ ├── newjson2pdf.js
│ │ │ │ └── old codes/
│ │ │ │ ├── oldjson2pdf.html
│ │ │ │ └── oldjson2pdf.js
│ │ │ ├── twindle-cli-node/
│ │ │ │ ├── README.md
│ │ │ │ ├── package.json
│ │ │ │ └── twindle.js
│ │ │ ├── twindle-hello-world-pdf/
│ │ │ │ ├── package.json
│ │ │ │ └── pdf.js
│ │ │ ├── twindle-thread/
│ │ │ │ ├── Readme.md
│ │ │ │ ├── script.js
│ │ │ │ └── twit_thread.json
│ │ │ └── twitter-api/
│ │ │ ├── README.md
│ │ │ ├── package.json
│ │ │ ├── responses/
│ │ │ │ ├── response-version1-searchendpoint.json
│ │ │ │ ├── response-version1-user-timeline.json
│ │ │ │ ├── response-version2-conversation.json
│ │ │ │ └── response-version2-tweetthread.json
│ │ │ ├── script-version1-searchendpoint.js
│ │ │ ├── script-version1-usertimeline.js
│ │ │ └── script-version2-conversation.js
│ │ ├── mock/
│ │ │ ├── README.md
│ │ │ ├── twit-thread.json
│ │ │ ├── twitter-recent-search-api-response.json
│ │ │ └── twitter-tweet-api-response.json
│ │ ├── tests/
│ │ │ ├── github/
│ │ │ │ ├── giturl.unit.test.js
│ │ │ │ └── repo.unit.test.js
│ │ │ └── twitter/
│ │ │ ├── api.test.js
│ │ │ ├── unit/
│ │ │ │ ├── api/
│ │ │ │ │ ├── helpers/
│ │ │ │ │ │ └── fetch.unit.test.js
│ │ │ │ │ └── twitter-endpoints/
│ │ │ │ │ ├── search.unit.test.js
│ │ │ │ │ └── tweets.unit.test.js
│ │ │ │ └── transformations/
│ │ │ │ └── helpers.unit.test.js
│ │ │ └── utils.test.js
│ │ └── twindleco/
│ │ ├── header/
│ │ │ ├── header1/
│ │ │ │ ├── header1.css
│ │ │ │ └── header1.html
│ │ │ ├── header2/
│ │ │ │ ├── header2.css
│ │ │ │ └── header2.html
│ │ │ ├── header3/
│ │ │ │ ├── header3.css
│ │ │ │ └── header3.html
│ │ │ ├── header4/
│ │ │ │ └── public/
│ │ │ │ ├── index.html
│ │ │ │ └── style.css
│ │ │ ├── header5/
│ │ │ │ ├── header_twindle.css
│ │ │ │ └── header_twindle.html
│ │ │ ├── header6/
│ │ │ │ ├── header6.css
│ │ │ │ └── header6.html
│ │ │ └── header7/
│ │ │ ├── header7.css
│ │ │ └── header7.html
│ │ ├── header8/
│ │ │ ├── header8.css
│ │ │ └── header8.html
│ │ ├── homepage/
│ │ │ ├── homepage1/
│ │ │ │ ├── Twindle Home Page.html
│ │ │ │ └── style.css
│ │ │ ├── homepage2/
│ │ │ │ ├── README.md
│ │ │ │ ├── index.html
│ │ │ │ ├── index.js
│ │ │ │ ├── style.css
│ │ │ │ └── style.scss
│ │ │ ├── homepage3/
│ │ │ │ ├── index.css
│ │ │ │ └── index.html
│ │ │ ├── homepage4/
│ │ │ │ ├── index.html
│ │ │ │ └── styles.css
│ │ │ ├── homepage6/
│ │ │ │ ├── home.css
│ │ │ │ └── home.html
│ │ │ └── homepage7/
│ │ │ ├── index.html
│ │ │ └── style.css
│ │ ├── readme.md
│ │ └── team/
│ │ └── team1/
│ │ ├── index.html
│ │ └── style.css
│ ├── twindle-thread/
│ │ ├── .gitignore
│ │ ├── .prettierrc
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── backend/
│ │ │ ├── README.md
│ │ │ ├── common.d.ts
│ │ │ ├── index.js
│ │ │ ├── jsconfig.json
│ │ │ ├── package.json
│ │ │ └── src/
│ │ │ ├── add-thread.js
│ │ │ ├── error/
│ │ │ │ ├── api.js
│ │ │ │ ├── base.js
│ │ │ │ ├── index.js
│ │ │ │ └── validation.js
│ │ │ ├── get-thread-data.js
│ │ │ ├── get-threads-list.js
│ │ │ ├── helpers/
│ │ │ │ ├── connection.js
│ │ │ │ ├── error.js
│ │ │ │ ├── score.js
│ │ │ │ └── setup-db.sql
│ │ │ └── twitter/
│ │ │ ├── constants.js
│ │ │ ├── helpers/
│ │ │ │ └── fetch.js
│ │ │ ├── index.js
│ │ │ ├── twitter-endpoints/
│ │ │ │ └── tweets.js
│ │ │ ├── types.d.ts
│ │ │ └── types.js
│ │ ├── jsconfig.json
│ │ ├── package.json
│ │ ├── public/
│ │ │ ├── css/
│ │ │ │ ├── global.css
│ │ │ │ └── theme.css
│ │ │ ├── index.html
│ │ │ └── robots.txt
│ │ ├── snowpack.config.js
│ │ ├── src/
│ │ │ ├── App.svelte
│ │ │ ├── components/
│ │ │ │ ├── Avatar.svelte
│ │ │ │ ├── Button.svelte
│ │ │ │ ├── IconButton.svelte
│ │ │ │ ├── list/
│ │ │ │ │ ├── List.svelte
│ │ │ │ │ ├── ListItem.svelte
│ │ │ │ │ └── listElStore.js
│ │ │ │ └── utils/
│ │ │ │ └── AppIcon.svelte
│ │ │ ├── constants.js
│ │ │ ├── helpers/
│ │ │ │ └── fetch.js
│ │ │ ├── index.js
│ │ │ └── pages/
│ │ │ └── Feed.svelte
│ │ ├── types.d.ts
│ │ ├── types.js
│ │ └── workbox-config.js
│ └── twindle-web/
│ ├── .prettierrc
│ ├── README.md
│ ├── dark-theme.css
│ ├── index.html
│ ├── index.js
│ ├── scripts/
│ │ ├── header.js
│ │ └── testimonials.js
│ ├── style.css
│ └── team_details/
│ ├── README.md
│ ├── data.json
│ ├── team_details.css
│ ├── team_details.html
│ └── team_details.js
└── twindle-cli/
├── .gitignore
├── .prettierrc
├── README.md
├── jsconfig.json
├── package.json
└── src/
├── cli.js
├── common.d.ts
├── env.js
├── fileOpener.js
├── github/
│ └── githubparse/
│ ├── app.js
│ ├── convert.js
│ └── jsonFetchData.js
├── hacker-news/
│ ├── code.js
│ └── hn.test.js
├── helpers/
│ ├── error.js
│ └── logger.js
├── index.js
├── readability/
│ └── index.js
├── renderer/
│ ├── epub/
│ │ ├── epub.js
│ │ ├── index.js
│ │ └── render-template.js
│ ├── index.js
│ ├── md/
│ │ ├── README.md
│ │ └── index.js
│ ├── mobi/
│ │ ├── README.md
│ │ └── index.js
│ └── pdf/
│ ├── create-pdf.js
│ ├── examples/
│ │ └── Twindle.html
│ ├── index.js
│ └── render-template.js
├── setup/
│ └── init.js
├── spinner.js
├── twindle.js
├── twitter/
│ ├── api/
│ │ ├── constants.js
│ │ ├── helpers/
│ │ │ └── fetch.js
│ │ ├── index.js
│ │ └── twitter-endpoints/
│ │ ├── search.js
│ │ ├── tweets.js
│ │ └── user_timeline.js
│ ├── error/
│ │ ├── api.js
│ │ ├── base.js
│ │ ├── index.js
│ │ └── validation.js
│ ├── index.js
│ ├── mock/
│ │ ├── delete-if-not-needed/
│ │ │ ├── data.js
│ │ │ └── dataaa.js
│ │ ├── twitter-mock-responses/
│ │ │ ├── images-text.json
│ │ │ ├── mock.json
│ │ │ └── only-links.json
│ │ └── twitter-responses/
│ │ ├── gif-retweet.json
│ │ ├── only-images.json
│ │ ├── only-text.json
│ │ ├── response-version2-tweetthread.json
│ │ ├── squirrel-pumpkin.json
│ │ └── username-hashtag.json
│ ├── scraping/
│ │ └── index.js
│ ├── transformations/
│ │ ├── helpers.js
│ │ ├── helpers.test.js
│ │ ├── rich-rendering.js
│ │ ├── rich-rendering.test.js
│ │ ├── search-endpoint.js
│ │ ├── tweet-endpoint.js
│ │ ├── tweets-array-Endpoint.test.js
│ │ ├── tweets-array-endpoint.js
│ │ ├── user-timeline-Endpoint.test.js
│ │ └── user-timeline-endpoint.js
│ ├── twitter.js
│ ├── utils/
│ │ ├── date.js
│ │ └── date.test.js
│ └── validations/
│ └── tweet-endpoint.js
├── types/
│ └── twitter.ts
├── types.js
└── utils/
├── date.js
├── env.js
├── helpers.js
├── helpers.test.js
├── image.js
├── image.test.js
├── library.js
├── path.js
├── path.test.js
├── send-email.js
└── send-to-kindle.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .all-contributorsrc
================================================
{
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"contributors": [
{
"login": "proful",
"name": "Proful Sadangi",
"avatar_url": "https://avatars2.githubusercontent.com/u/354596?v=4",
"profile": "https://github.com/proful",
"contributions": [
"code",
"ideas"
]
},
{
"login": "tr0mbl3y",
"name": "tr0mbl3y",
"avatar_url": "https://avatars2.githubusercontent.com/u/72851843?v=4",
"profile": "https://github.com/tr0mbl3y",
"contributions": [
"code"
]
},
{
"login": "PuruVJ",
"name": "Puru Vijay",
"avatar_url": "https://avatars2.githubusercontent.com/u/47742487?v=4",
"profile": "https://puruvj.dev",
"contributions": [
"code"
]
},
{
"login": "johnjacobkenny",
"name": "Kenny John Jacob",
"avatar_url": "https://avatars1.githubusercontent.com/u/19240564?v=4",
"profile": "https://kennyj.me/",
"contributions": [
"code"
]
},
{
"login": "Mira-Alf",
"name": "Mira-Alf",
"avatar_url": "https://avatars0.githubusercontent.com/u/64691316?v=4",
"profile": "https://github.com/Mira-Alf",
"contributions": [
"code"
]
},
{
"login": "Akshay2996",
"name": "Akshay Sharma",
"avatar_url": "https://avatars0.githubusercontent.com/u/37118877?v=4",
"profile": "https://www.developeratease.com/",
"contributions": [
"code",
"design"
]
},
{
"login": "shekhar10feb",
"name": "Shekhar Ranjan",
"avatar_url": "https://avatars0.githubusercontent.com/u/72906055?v=4",
"profile": "https://codepen.io/shekhar4nov",
"contributions": [
"code"
]
},
{
"login": "tolgaerdonmez",
"name": "Tolga Erdönmez",
"avatar_url": "https://avatars0.githubusercontent.com/u/45141388?v=4",
"profile": "http://tidible.app",
"contributions": [
"code"
]
},
{
"login": "UnevenCoder",
"name": "Ameen Shafeeq",
"avatar_url": "https://avatars0.githubusercontent.com/u/49345531?v=4",
"profile": "https://m.youtube.com/channel/UCKmIFs7rFKdTE6t1y8bKAHQ/videos",
"contributions": [
"code"
]
},
{
"login": "SarveshKadam",
"name": "Sarvesh Kadam",
"avatar_url": "https://avatars1.githubusercontent.com/u/66166738?v=4",
"profile": "https://www.sarveshkadam.com/",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
"projectName": "twindle",
"projectOwner": "twindle-co",
"repoType": "github",
"repoHost": "https://github.com",
"skipCi": true
}
================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
## Description
## Attach Screenshot
> Note 2 code reviewer approval needed. Approach in twitter group & discord channel.
================================================
FILE: .github/TEMP_ISSUE_TEMPLATE.md
================================================
# Temporarily disabled
> Please provide us with the following information:
> ---------------------------------------------------------------
### This issue is for a: (mark with an `x`)
- [ ] Merge conflict solution
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped recently)
### Minimal steps to reproduce
>
### Expected/desired behavior
>
### Mention any other details that might be useful
> ---------------------------------------------------------------
> Thanks!
================================================
FILE: .github/workflows/conflict.yml
================================================
name: Add label on merge conflict
on:
pull_request_target:
branches: [ main ]
jobs:
add-label:
runs-on: ubuntu-latest
steps:
- name: Label Conflicting Pull Requests
uses: eps1lon/actions-label-merge-conflict@v2.0.0
with:
dirtyLabel: "Merge Conflict"
repoToken: "${{ secrets.GITHUB_TOKEN }}"
commentOnDirty: "This pull request has conflicts, which you need to resolve! :partying_face: Don't need to worry at all, please follow the steps here - https://github.com/twindle-co/twindle/wiki/Resolving-merge-conflicts"
commentOnClean: "Conflicts have been resolved. A maintainer will review the pull request shortly."
================================================
FILE: .github/workflows/stale.yml
================================================
name: Mark stale issues and pull requests
on:
schedule:
- cron: "0 0 * * *"
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is getting old :older_adult:'
stale-pr-message: 'This PR is getting old :older_adult:'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
================================================
FILE: .github/workflows/tests.yml
================================================
name: Node.js Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: NPM Install
working-directory: ./twindle-cli
run: npm install
- name: Run Tests
working-directory: ./twindle-cli
run: npm run test
================================================
FILE: .gitignore
================================================
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
yarn.lock
# Confidential email config
nodemailer.config.js
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# Next.js build output
.next
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Environment variables
.env
.DS_Store
main
twindle-web/scss/
twindle-web/style.scss
twindle-web/style.css.map
================================================
FILE: CNAME
================================================
www.twindle.co
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2020 twindle-co
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# [Twindle](https://twindle-co.github.io/twindle/.) 📖
[](#contributors-)
> ### An open source project for beginners.
>
> ### Converting twitter threads to pdf, epub and mobi format to be read by Kindle.
[](https://github.com/firstcontributions/open-source-badges) [](http://makeapullrequest.com)
[](https://opensource.org/licenses/MIT)

### Hangout with Twindle developer => Discord [
](https://discord.gg/jBj2zMR)
## Want to contribute on twindle cli
Pre-requsites
- JavaScript
- Node.js (basic)
Initial code goes into twindle-cli
```
cd twindle-cli
npm install
cp .env.example .env
```
*Note:* Create .env file under twindle-cli
You need Twitter Developer API bearer token ([instructions](https://github.com/twindle-co/twindle/wiki/Applying-for-Developer-Access-from-Twitter))
# How to Run twindle?
```
node . -i 1002103360646823936
```
## Reading sources suppoorted
✅ Twitter Thread
✅ Hacker News Comments
✅ Github markdown pages
✅ Any articles (URL)
## Connect with us
[
](https://twitter.com/twindleco)
[](https://www.youtube.com/channel/UCKxUmbHq5P5pd5IyUiZ8MHA)
[
](https://discord.gg/jBj2zMR)
## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Proful Sadangi 💻 🤔 |
tr0mbl3y 💻 |
Puru Vijay 💻 |
Kenny John Jacob 💻 |
Mira-Alf 💻 |
Akshay Sharma 💻 🎨 |
Shekhar Ranjan 💻 |
Tolga Erdönmez 💻 |
Ameen Shafeeq 💻 |
Sarvesh Kadam 💻 |
| [Pranav Goel](https://github.com/pranavgoel29) | I'm from India, Have basic knowledge of HTML, CSS, C++ and C, I'm currently learning Javascript. |
| | [Adewale Abiola](https://github.com/princehaybee) | I am a Nigerian. I have basic knowledge of HTML,CSS and Javascript. |
|
| [Micheal Aderinto](https://github.com/ad3rinto) | Manchester UK, Hoping this will be my first step in the world of solving world problems with code. |
|
| Usha Kiran ([K!r@nD0n](https://twitter.com/ushakiran_m)) | I am a student from India. I just started my OpenSource journey with TWINDLE. I am currently learning #JavaScript. |
|
| [Eyram ](https://twitter.com/Ey_kwasi) | I am from Ghana and I have no experience, started learning web development some months ago. I am participating to learn and also make twindle a success. |
|
| [Michael Osajeh](https://github.com/michaelcosj) | I am from Lagos, Nigeria, second year Computer Science Undergraduate, started learning web and mobile development this year. I have basic knowledge of javascript, python, c++, dart and golang. |
| | [Tushar Kandpal](https://github.com/tusharkandpal) | From India, Contributing in making **twindle** a succees, Always a Learner :v: |
|  | [Rafael Rodrigues](https://github.com/RafaelBatman55) | Less than 1 yr of experience From small city in Rio de Janeiro State - Braz.I'm very excited to learn and helf in this project! |
| | [Yaksh Bariya](https://www.github.com/thunder-coding) | I am from India. A 14 year old technology lover. I create amazing things using the knowledge I have gained so far. Currently, I want to explore more of JavaScript/TypeScript. |
| | [Nishank Navelkar](https://www.github.com/nishanknavelkar) | Im from India, Basic knoweledge of Python, C, C++, HTML, CSS, Electrical engineer, Here to learn and Contribute. |
| | [Manohar Rajaram](https://github.com/manohar52) | I am from India but currently pursuing my Masters in computer science in US. I am quite new to Javascript. I have some experience in HTML, CSS and PHP. |
| | [Naveen Kala](https://github.com/naveenkala) | I'm an engineering student from India. Having basic knowledge of HTML, CSS and JavaScript. Currently I am learning Reactjs. |
| | [Alasi Habeeb](https://github.com/Holaryeankar007) | I'm from Nigeria, I have experience in HTML and CSS but i'm currently learning Javascript. |
|  | [Sheetal Pandey](https://github.com/Sheetal777) | A keen learner from India pursuing engineering. Good with Python and new to Web Developement. |
|
| [Regina Gachomba](https://github.com/MumbiGachomba04) | I am a Kenyan undergraduate student currently based in Ankara, Turkey. During my first year in college I learnt C,C++ and python. I am currently learning Java OOP for my coursework and teaching myself HTML,CSS and Javascript. Looking forward to master front-end development at the moment, then hopefully I can begin learning back-end. |
| | [Swati Rao](https://github.com/SwatiRaoDataEnthusiast) | I am from India,I am familiar with HTML,CSS and can learn Node.JS, javascript etc. This is the my first open source project TWINDLE. Really excited!! |
| | [Prathap](https://github.com/codeprm) | From India. Newbie to UI tech. CS Student, 4+ exp. |
|  | [Fabio Duarte](https://github.com/lh536) | I am from Colombia. I have some experience with HTML, CSS and JavaScript. Lately I've been learning Tailwindcss, ParcelJS, NodeJS and a first lesson of VueJS. I like listen to music (play guitar and drums), airplanes, cooking, video/photography and science; actually I'm biologist, but I love coding since I was in the school. I hope I can contribute to twindle. I'm always learning. |
| | [Nahuel Alfano](https://github.com/NahuelAlfano) | I am from Argentina, beginner at github and open source projects. I have basic knowledge of HTML, CSS, Javascript, C#, C++, currently learning Python. |
| | [Tr0mbley](https://github.com/tr0mbl3y) | learning how things works! nothing to share much |
| | [Sippeybro](https://github.com/sippeybro) | I'm from Maldives, Have basic knowledge of HTML, CSS, php and I'm currently learning Javascript. |
| | [Titi Olopade](https://github.com/teckiegeek) | I am from the United Kingdom. My background is Computing and Statistics with a MSc. in Agile Project Management and PRINCE2 certified,i SCRUM Master Certified. I have several years professional experience with few years career break. I started learning HTML and CSS coding 6months ago. I plan a change in career to be a Front-end developer. Here to learn and contribute to success of "twindle". |
| | [luli](https://github.com/ululi) | I'm from zambia,have some basic knowledge of html, css and js, am here to learn more about web development. |
| | [Ashish](https://github.com/kambleaa007) | 3+ yr of experience in .Net Java JavaScript Testing, Pune, India SoReady2Help :partying_face: |
|
| [Nneyen ](https://github.com/Na-ilah) | I am from Nigeria. I am beginner at github and open source projects. I have basic knowlege of Python, HTML and CSS. I don't remember much about programming even if I have a degree in computing. I would like to be able to contribute to the open source community and build educational solutions. |
| | [Harsha Vardhan](https://github.com/Harsha-Ambati) | I am a student from India, recently came into this web development field, had basic knowledge in HTML, CSS, JavaScript. |
| | [Maria Rivera](https://github.com/GorettiRivera) | I have basic knowledge of Javascript, HTML and CSS. Currently working in different open source projects |
| | [Neaz Mahmood](https://github.com/Neaz-Mahmood) | I am from Dhaka, Bangladesh. I am a second year Computer Science undergraduate. I know basic html, css, javascript. I am here to learn & contribute to 'twindle'. This is my first open source project. |
| | [Predrag](https://github.com/stamenkovic-dev) | I'm from Serbia, and I have only basic knowledge of HTML and CSS, but I'm here to learn more about web development and team play at coding. |
|
| [Franklin U.O. Ohaegbulam](https://github.com/frankiefab100) | I'm comfortable working with HTML and CSS, with basic knowledge of JavaScript. I'm from Nigeria and love talking about accessibility, inclusive design and web animation. |
| | [Aravind Sivasailam](https://github.com/aravindsivasailam) | I'm a product engineer living in US with 2 years of experience in software testing and project management. New to software development and wish to improve in HTML, CSS and JS. |
| | [Edwin Mancipe](https://github.com/efmg0325) | I am from Colombia. I have a bit of knowledge about HTML, CSS, Javascript, Python and SQL. I love to listeninng to Heavy Metal music. I like second life web browser games. |
| | [Edori Atiri](https://github.com/EdoriAtiri) | From Nigeria. Began to learn Web Development this year. I hope to learn and contribute while I'm here. |
| | [Lorenna Leon](https://github.com/lorennaleon) | I am Peruvian, I have knowledge in html, css and javascripts I hope to learn a lot from you |
|
| [Shekhar Ranjan](https://github.com/shekhar10feb) | I'm from India, have basic knowledge of Java, SQL, HTML, CSS and still learning JavaScript, want to learn more and explore advance stuffs. |
|
| [Chioma Vera Nkanmuo](https://github.com/chiomavera) | Hi,I'm Chioma Vera Nkanmuo, Beginner Web developer from Nigeria with basic knowledge of HTML and CSS. I am currently in my penultimate level in university. Learning while contributing in making twindle a success. |
---
| [PraveenKumar](https://github.com/praveen2896) | I'm from India, having 3 years of professional experience in Backend, new to JS,HTML,CSS ,Planning to learn React in future with the help of #twindle. |
| | [Vipin Rawat](https://github.com/aesthytik) | I'm a frontend Engineer from Punjab,India. 2+ years experience in React Native and React js. I create Logos and graphics for fun.Happy to help :) |
|
| [Satyaki Bose](https://github.com/satyaki07) | I'm a newbie in MERN stack from Kolkata, India with 1+ years of experience. :) |
|  | [Aparna Sivasailam](https://github.com/Mira-Alf) | I'm from Bengaluru, India. Tech woman on a career break with 6 years of Java Experience. Trying to upskill myself with Javascript and UI/UX design |
| | [Rajesh](https://github.com/rkumar1904) | I'm a Lead frontend developer from Mumbai, India. Total 9+ years experience in front end technology. Currently working on ReactJS & Flutter. Initially, I started my career as a Programming Faculty. |
| | [Sunny](https://github.com/SunnyDev7) | I am Sunny from India and a engineering student. And i am working on MERN stack and also comfortable with html, css and vanilla js and am Here to learn, collaborate and help. |
|
| [Joel Vinay Kumar](https://github.com/JoelVinayKumar) | I'm a FullStack Developer from Hyderabad, India. Worked on building microservices, web apps and mobile apps. I learned UI design out of passion. I'm proud of any small contribution to Twindle |
|
| [Nitin Kadam](https://github.com/ni3-kdm) | Full stack developer from Pune, India. 5+ years of experience in the web development 👩🏽💻. |
|
| [Marcus](https://github.com/mar-code) | I'm a self taught frontend developer from Lagos, Nigeria with experience in HTML/CSS, Javascript, React, Redux, bootstrap and d3 data presentation. i am currently learning NodeJs. |
| | [Samuel Adeniyi](https://github.com/samueladeniyi) | I am proficient in HTML, CSS and Javascript. I am comfortable with react. I intend to become a fullstack developer with the MERN stack. I am from Nigeria. |
|
| [Aditya Satpute](https://github.com/Foxtrot-1418) | I'm a Full Stack Web Developer From Nashik, Maharashtra, India. I've experience in HTML, CSS, JS, Jquery, Bootstrap, PHP and currently working fo r Multinational Company as AWS Developer.
|
| [Samuel Adeniyi](https://github.com/samueladeniyi) | I am proficient in HTML, CSS and Javascript. I am comfortable with react. I intend to become a fullstack developer with the MERN stack. I am from Nigeria.
---
| [Proful](https://github.com/proful) | 15 yr of experience From India, Living in Sydney Actively participating to make twindle a success. |
|  | Kenny John Jacob | 4+ yrs of experience. From Kerala, India. Here to help :partying_face: |
| | Kingsley | 3+ yrs of experience. Based in Nigeria and here to help :man_technologist: |
| | [Pratham](https://github.com/prasoonpratham) | 2+ experience in JavaScript, always open to help :smile: |
| | [Sarath](http://http://www.sarathnagaraj.ca/) | 6+ experience in JavaScript, Currently working on a side project using ReactJS :man_technologist: |
| | [Puru Vijay](https://github.com/puruvj) | 5+ experience in HTML, CSS, JS, Angular, React, Svelte, NodeJS, Python, StencilJS, Firebase, feel free to ping me for help 😁 |
================================================
FILE: misc/docs/TWINDLE.md
================================================
# Why should twitter users consider Twindle to read through Twitter thread?
Before we dive into what Twindle aims to solve and why to consider Twindle as the first set of choices to read through informative threads on Twitter, let's take a look at the existing problem in reading through or following a long thread on Twitter.
### The Problem
Twitter threads are a common way, nowadays, to share informative content about diverse subjects quickly instead of writing up a blog post on Medium or a personal website. On every clock tick, the twitter feed volume grows exponentially; thus, keeping tracking of the threads that users find useful has become a painstaking process;
### Existing Solutions
Widely used approaches are to track is to retweet, like the tweet revisit later by scrolling through your likes feed.
Alternatively, a Twitter bot named threadreaderapp was introduced to address the pain point by allowing users to retweet on the original post and get a link that combines all the information related to the thread in one place through a URL. Non-twitter users can also access the URL.
### Limitations of threadreaderapp
Although the threadreaderapp alleviates the pain point, there are some limitations in using the threadreaderapp bot as follows.
- If the thread owner blocks the threadreaderapp bot, it will not access the thread content.
- If the thread owner is a private user, the bot will not access the thread content.
- The threadreaderapp bot can only access up to 3000 tweets per user
- Threads get deleted from the app when they are deleted by the author or Twitter because the app site is in sync with Twitter. The only way to avoid this is a premium membership which allows threads to be saved as PDF files.
- Finally, the reader must connect to the internet to access the URL
### Twindle: Access thread content offline as well
In walks Twindle, a web application allows users to convert threads on Twitter to pdf or ePub format.
- The users can store the pdf/ePub on a digital device
- The users can store the pdf/ePub on cloud services i.e, Dropbox, Google Drive and access offline,
- Otherwise, print a hard copy and read like a good-old-traditional-reader.
================================================
FILE: misc/docs/TWITTER.md
================================================
# 18 OCT 2029
How to make a PR directly from vscode
@Pranavgoel_29 #twindle
https://www.youtube.com/watch?v=ZQqfZt1RIpA
================================================
FILE: misc/docs/articles/Process-for-new-contributors.md
================================================
Hi everyone :wave:, usually when people get connected to an open-source project(which is yes, pretty much exciting :open_mouth: ), they are mostly unware about the project. Sure, they have some knowledge about the project but not enough to contribute to it. So, they must have enough knowledge about the project and the process, like to do what or where should they first start, etc.
That's where this article comes in handy :metal: , as suggested by @Proful to write. So, let's go and try to know every process step by step.
### Step 1
From the [twindle-co](https://github.com/twindle-co/twindle) to get a copy of that github account in your account.
### Step 2
Download [Git](https://git-scm.com/) and [connect the github account to it](https://linuxize.com/post/how-to-configure-git-username-and-email/).
### Step 3
Fork Twindle repository by clicking on the `Fork` button on top right corner. This will make your own copy of Twindle's code, and it will be synced up to the upstream(i.e, `twindle-co/twindle` in this case).
### Step 4
Clone the git repository from your github account into your local machine using git `bash`/ terminal (Most likely, it's git bash for windows users).There are different ways to clone a repository into your local machine, like you can use HTTPS, SSH or GitHub CLI, but this below will do it for everyone.
```bash
git clone https://github.com/[YOUR_USERNAME]/twindle.git
```
Replace `[YOUR_USERNAME]` with your git username.
The whole repository will be copied in that folder.
> :mushroom: Tip: Always remember to work or make changes in a new branch, for this, you have to create a new branch and then, work in it like make changes or add something.
What is Pull Request and why should we raise one? :confused: Pull Request(PR) is just you requesting from the authority, the original upstream branch, whose application you have forked, and in that forked application, you have done some changes or added some codes. To incorporate those changes in the main file, you have to raise a pull request(pr) to the authority. So, just making some meaningful changes and save it in your account won't be beneficial until those changes are added in to the main file. That's where pull request(pr) comes into the picture.
### Step 5
Make a new branch in your fork.
> :mushroom: Tip: Before raising a pr from the main branch in order to merge your changes into the main file, always update your repository by pulling latest code from upstream branch by running this 👇
```bash
git pull upstream main
```
And you can update your github account with the parent repository by following this amazing article written by @SarveshKadam [Sync to main repo using pull request](https://github.com/twindle-co/twindle/blob/main/docs/articles/sync-to-main-repo-using-pull-request.md).
### Step 6
Now, we are ready to raise our first PR in upstream. So, we need to do this by using our github account by following the steps given below:
- Switch to our new branch
- Go to firstpr
- Click on the add file button(on upper right hand side)
- Click Create new file
- Give a name of your file like yourName.md, where .md is the name of the markdown extension
- Now, write about yourself in the space given below. Here, you have to use markdown language.
> :mushroom: Tip: Markdown Language is a simple markup language, one can use to format any doucment. If you want to learn basic syntax, you can go here :point_right: [Markdown Language](https://www.markdownguide.org/basic-syntax/).
### Step 7
Now, we are going for the 2nd pr but this time, we are raising a pr through our local machine. For this, again update your repo first in your both local as well
as remote account and you should follow this, `twindle/docs/Team.md` in your local branch. This is about the team members, where one has to write his/her name with
github account link and some description about himself/herself using markdown language. For pushing the changes from your local machine to your github account, you need to execute this
command,
```bash
git push origin [new-branch]
```
where, `origin` is the remote name. Please go here, if you want to know more [Gt Commands](https://github.com/twindle-co/twindle/blob/main/docs/articles/git%20-github-related.md).
> :mushroom: Tip: If you are facing pr commit issue then, please go through this very nice article written by @PuruVJ [PR Clean Commits](https://github.com/twindle-co/twindle/blob/main/docs/articles/pr-clean-commits.md).
### Step 8
:sound: So, you are about to raise your 3rd pr. In the 3rd pr, you will add your photo in the `Team.md`. First, you need to upload your photo here, `twindle/docs/images/team` through new branch by raising pr. After merging the changes, update your repo(it's compulsory) and then, go to `twindle/docs/TEAM.md` in your new branch and edit the page, put this code `
` in the image section in front of your name, according to the markdown syntax.
> :mushroom: Tip: In between doing these things, you can write article also, where you can share simple approach of doing the steps, where you feel difficulties. This wiil surely give
you confidence to express yourself and makes it easier for people to learn new things :relaxed: .
### Step 9
Now, you can select any of the section like either you can go to twindle-cli, twindl-web or twindle-thread according to your choice.
Suggestions are welcome !! :blush:
================================================
FILE: misc/docs/articles/README.md
================================================
# Articles
Create an article here and add it as a link on the main project readme file. This will show up on the website as links.
================================================
FILE: misc/docs/articles/creating-first-pull-request.md
================================================
I hope the following screenshots will help with your first pull request.
Firstly create your account on github and goto twindle repository page [here](https://github.com/twindle-co/twindle)
Now you can follow the following steps.
Step 1

Step 2

Step 3

Step 4

Step 5

Step 6

Step 7

Step 8

Step 9

Step10

================================================
FILE: misc/docs/articles/design-guide-for-good-logo.md
================================================
There are some teams and logos you see, no matter where you are in the world, and you know exactly who they are and what they mean.
## Hi everyone, this is Vipin, a frontend dev from Punjab, India with good knowledge of design and UI/UX.
Twindle has got a lot of overwhelming response from the dev community and and begginers have also flooded their ideas for branding and logos.
As we are designing a logo, some things should be taken in my mind (of course there is no hard and fast rule 😅)
# 1. LOGO DESIGN MUST REFLECT YOUR BUSINESS
Your logo needs to help your business stand out in a crowd, but in a way where the person looking at it can easily identify that it is your unique company. If you can incorporate into the logo key elements that your business represents, you have a better chance of people remembering it.
# 2. KEEP IT SIMPLE
Stop with all that clutter. Trying to squeeze too much into a logo can have a negative impact.
# 3. MAKE A STATEMENT IN BLACK & WHITE AND COLOUR
Make certain that your logo works well - both in colour and in black and white.
If the logo loses impact in black and white, it is going to be a problem when you have to print in newspapers or utilise services that only use black ink. Ensure that a colourful logo design translates well visually into black & white.
# 4. A SCALABLE SOLUTION
our logo has to be scalable to be effective.
Your logo might look great on your letterhead, but what happens when you have to reduce the size for a business card or online forum? The rule of thumb when it comes to scalable logos, is that your logo should look good - whether on a business card or a billboard. If you can accomplish that, you have a great logo design.
# 5. KEEP IT BALANCED
Your logo should be designed to stand the test of time too. Ensure that your design does not make overt use of fashion trends - or you may find your logo is quickly dated.
Once you have decided what logo is perfect for your business, be sure to have it converted in JPG, GIF, and EPS format. This way you can easily use the logo for your printed materials and website.
Once you have all these key elements in place, we come to the most important part of a successful logo design and brand statement.
Now that you have your logo, and it has been broadcast to the world, it is vital you always use your logo in a consistent manner.
Don't alter your logo for certain flyers or brochures. Not only will this confuse your audience, it risks looking less than professional. You can reduce and enlarge the logo for different formats, but never change the essence of the design.
================================================
FILE: misc/docs/articles/git -github-related.md
================================================
Hello friends :wave: :smiley: , when we talk about **git** and **github** then, there are lot of confusion :confused: exist in our mind. Especially,
when we talk about their commands. I also encountered with the same issue and mentors helped me and motivate me to face this and gave me some suggestions
in order to overcome this. And thanks to the mentors, who suggested me to write an article about it. So, here I am writing about some concepts, which
are related to **github** and **git** and some commands(which you can use it in _git bash_, _cmd_ or _vscode terminal_) too, which, I hope, would be very
helpful for everyone.
So, here we are discussing about following terms, which might be very important:
- Fork
- Branches
- Push commit to a remote repository
### Fork
When we **fork** a repository, in our case we **fork** the **Twindle** repository then, we get a personal copy of the repository in our **github**
account, where we are free to make changes without affecting the main project. When we do some changes in our own repository and want to implement these changes
in the main project then, we raise pull request(PR). The authority of the main project review the changes and if they think it is good to include this
change in the main project then, they add it( you everytime want this to happen ) otherwise, reject it( sorry, but it happens too ).
### Branches
**Branches** are almost like a new copy of our code at the current state( it means you forked a repository, which becomes "master" version in your
repository and then, you make a copy of your "master" version ), which can then be used to develop
new code.For example, whenever we need to create a new feature, or rewrite any of our code, it's a good thing to create a new branch so that none
of our changes affect the "master" version of the code. This is important since it can be very difficult to revert code changes from memory,
especially in complex systems. And also there are many changes happen in the "master" version of the main repository like in **Twindle**, people work
on the code and raise PR requests. If we try to raise PR request from our "master" version then, the PR requests raised by the people will also get
added in our raised PR and this creates mess. So, to avoid these problems, we need to create a branch, raise PR request from that branch, this will
avoid others' PR requests and _when the PR request is approved then, that branch must be deleted._
First of all, when we are creating a branch using _git bash_ then, we must assure that we are in the main branch as shown below:

Here, in the above photo, "(main)" shows that we are in the main branch. Now, there are certain commands we should know and these are as follows:
- To initialize a repository for a new or existing project,
git init
- To create a branch from the current branch
git branch {{firstname}} {{lastname}}
``` If applied to the input object ``` { firstname: "Vijaya", lastname: "Bhaskar", } ``` the expressions will be replaced by the corresponding properties. The result is then ```Vijaya Bhaskar
``` ( React JS people can already feel familiar with this by props-components thing 😃 ) ### **How to utilize Handlebars in Twindle project?** Already @tolgaerdonmez has implemented Handlebars to create a HTML from a template. Lets decode his code 😄 Following is the code from the template [Thread.hbs](https://github.com/twindle-co/twindle/blob/main/playground/cli/pdf-from-html-cli/templates/Thread.hbs) ```{{createdAt}}
{{tweet}}
From the documentation
> Puppeteer is a Node library which provides a high-level API to control headless Chrome or Chromium over the DevTools Protocol.
In other words, it is a Node library that we can use to control a headless Chrome instance. That means we are actually using Chrome, but programmatically using JavaScript. And "headless Chrome" is Chrome without the graphical user interface.
(OK, thats alot of Chromes :hammer: :grinning: )
### **Why do we need Puppeteer?**
We know that using Twindle we convert long twitter threads to readable PDFs/ePubs. So in that process we create HTML from Twitter thread content and then convert that HTML to PDFs
> Twitter thread --> HTML --> PDF
[Previously](https://github.com/twindle-co/twindle/issues/415) we have seen how we can use Handlebars to compose HTML from Twitter thread content and will now convert that HTML to PDF with the help of Puppeteer ( atleast for now :grinning: )
> We need Puppeteer to render the HTML content in the headless browser so that we can perform print operation to convert the content to PDF.
### **How to utilize Puppeteer in Twindle project?**
Already @tolgaerdonmez has implemented Puppeteer to generate PDF from HTML. Lets dissect the code :grinning: :hocho:
Following is the code from [create-pdf.js](https://github.com/twindle-co/twindle/blob/main/playground/cli/pdf-from-html-cli/create-pdf.js)
```
const puppeteer = require("puppeteer");
const fs = require("fs");
// Creates a pdf document from htmlContent and saves it to outputPath
async function createPdf(outputPath, htmlContent) {
// launchs a puppeteer browser instance and opens a new page
const browser = await puppeteer.launch();
const page = await browser.newPage();
// sets the html of the page to htmlContent argument
await page.setContent(htmlContent);
// Prints the html page to pdf document and saves it to given outputPath
await page.emulateMediaType("print");
await page.pdf({ path: outputPath, format: "A4" });
// Closing the puppeteer browser instance
await browser.close();
}
module.exports = createPdf;
```
In the code above we are basically using headless Chrome browser to print content to PDF.
Though the code is self explanatory, let me explain it ( atleast for the sake of this issue :grimacing: )
Firstly we are including modules:
puppeteer -- for rendering HTML and printing to PDF.
fs -- Node.js file system module to work with the file system on your computer.
And we are creating an async function here with await as we have to perform each step after execution of the previous one.
As simple as we cannot print content without first loading the content. Lets see the process in 3 simple steps.
Step 1: Launching a new browser instance and then opening a new page.
```
const browser = await puppeteer.launch();
const page = await browser.newPage();
```
================================================
FILE: misc/firstpr/alejandra_pinto.md
================================================
### Hi there 👋
My name is Alejandra, I´m Developer in process...
----
- 🔭 I’m currently working on Projects startup
- 🌱 I’m currently learning Dart, Flutter and Phyton
- 👯 I’m looking to collaborate on Mobile Apps.
- 🤔 I’m looking for help with Haskell
- 💬 Ask me about Java, c++ and Git.
================================================
FILE: misc/firstpr/alexis.md
================================================
I'm Alexis Rivas from México, a just graduated Computer Systems Engineer and a newbie in the open source development, I hope learn and contribute everything what I can.
================================================
FILE: misc/firstpr/ali.md
================================================
Ali Ka from Sénégal. CS student, comfortable with HTML/CSS bootstrap and javascript.
================================================
FILE: misc/firstpr/andrei.md
================================================
Andrei Dan
From Romania
beginner to html, css and javvascript
================================================
FILE: misc/firstpr/anujshukla.md
================================================
Hey this is Anuj from Kushinagar India, I am currently an undergrad at VIT Vellore, India. I love the frontend development and I aspire to become a full stack developer. Other than code and coffee I really like traveling and reading books
================================================
FILE: misc/firstpr/aparna.md
================================================
Aparna a tech woman on break living in Bangalore with five years of experience in Java and Java EE. Trying to get into ES6 Javascript and building projects with it.
My second PR update.
================================================
FILE: misc/firstpr/aravind.md
================================================
My name is Aravind. I'm a product engineer living in US with 2 years of experience in software testing and project management. New to software development and wish to improve in HTML, CSS and JS.
================================================
FILE: misc/firstpr/arthurbuhl.md
================================================
### Hi there 👋
I am Arthur Buhl. Web developer with basic knowledge of HTML, CSS and JS.
### Learning PR
- This is my second PR using terminal.
================================================
FILE: misc/firstpr/ashish.md
================================================
Hello I'm ashish,
A former QA engineer, now a front-end developer
Looking forward to contribute on twindle.
================================================
FILE: misc/firstpr/baijanath.md
================================================
Hey, I am Baijanath Tharu from Nepal. I have been learning MERN stack for few months. I am comfortable with HTML, CSS, JavaScript, ReactJs and NodeJs. I am really excited to make some contributions to this project.
================================================
FILE: misc/firstpr/bill.md
================================================
# Hello 👋
I am Bill from Indonesia. Aspired to become a front-end web developer.
I learned web programming for the first time in the early August 2020.
I have learned HTML, CSS, JavaScript, and React so far.
Looking forward to make meaningful contribution in this project ‼
================================================
FILE: misc/firstpr/blessing.md
================================================
Olaleye Blessing, student. Little bit comfortable with HTML, CSS and JS
================================================
FILE: misc/firstpr/can.md
================================================
Can Koçman,
From Turkey,
Student and Developer.
local PR
================================================
FILE: misc/firstpr/chimdie.md
================================================
_That really felt good once again._
================================================
FILE: misc/firstpr/codekumar.md
================================================
Ashish Kamble, ( kambleaa007.github.io ) Full Stack Developer - 3+ Years of experience in coding
================================================
FILE: misc/firstpr/daniel.md
================================================
Hello! I'm Daniel, currently a CS student and a web developer.
================================================
FILE: misc/firstpr/davabalan.md
================================================
Davabalan
================================================
FILE: misc/firstpr/deepak.md
================================================
Deepak - From Barh, Patna, language : C > HTML > JS : Beginner
================================================
FILE: misc/firstpr/deepak1_try2.md
================================================
Deepak- i have no experience in coding except C at college level and HTML & JS as hobby ( Self taught).
================================================
FILE: misc/firstpr/edori.md
================================================
Hello, I am Edori from Nigeria. I started learning how to use HTML, CSS and Javascript this year.
This is the second PR
================================================
FILE: misc/firstpr/edwin.md
================================================
My name is Edwin Mancipe.
I am from Colombia.
I am 43 years old.
I have some experience with javascript and python.
I am beginner
Twindle rocks!
2ndPR take 3 :|
================================================
FILE: misc/firstpr/eyram.md
================================================
hi, Eyram is name from Ghana.i started learning web develop some months ago.
Second pr.
================================================
FILE: misc/firstpr/fabio.md
================================================
#### Fabio Duarte
I'm from Colombia.
I'm a beginner with some experience in HTML, CSS and JavaScript. Lately I've been using Tailwindcss.
I can code a simple webpage from scratch but I don't know how to connect it with backend. I really appreciate all your advices and experience in order to improve my knowledge.
================================================
FILE: misc/firstpr/franklinulrich.md
================================================
Hello I'm [Franklin](https://twitter.com/frankiefab100), a multidisciplinary Designer and UI Developer from a Biological sciences background.
================================================
FILE: misc/firstpr/fusen.md
================================================
I am Fusen Ye from China.
A beginner of HTML,CSS and JavaScript.
I want to contribute to the project.
This my first pr.
if I make some mistakes,please forgive me.
I like hot weather.
I want to make a little progress every day.
================================================
FILE: misc/firstpr/habeeb.md
================================================
I am Alasi. I have basic knowledge of HTML and CSS but currently learning Javascript.
================================================
FILE: misc/firstpr/harsha.md
================================================
## Hello World!






[](https://github.com/anuraghazra/github-readme-stats)

[](https://github.com/krishnadevz/github-profile-trophy)
================================================
FILE: misc/firstpr/pr_m.md
================================================
#Prathap
CS Student. Now a working professional for a big bank.
I never got a chance to work on open source or UI dev project. So, trying to improve my skills through this project.
================================================
FILE: misc/firstpr/prajwal.md
================================================
Prajwal Pradhan From Nepal, 2 years of developement experience. Specialise in React.js.
================================================
FILE: misc/firstpr/pranav.md
================================================
## Pranav Goel
From Uttar Pradesh, India
### Skills
HTML, CSS, C++, C
- I am just starting with javascript.
================================================
FILE: misc/firstpr/prasanna.md
================================================
Prasanna from Tamil Nadu , India with 5 years of development experience in .Net
================================================
FILE: misc/firstpr/praveen.md
================================================
Praveen from TamilNadu Having 3 years of experience as a Backend developer
================================================
FILE: misc/firstpr/pravin.md
================================================
Pravinraj - Sofware Engineer focused on frontend technologies
================================================
FILE: misc/firstpr/predrag_stamenkovic.md
================================================
Predrag Stamenkovic,a
HTML and CSS beginner
My name is Predrag Stamenkovic from Belgrade - Serbia.
I work as Purchasing Manager in Jokey company, but very determined to become web developer in near future.
Currently learning HTML and CSS.
You can reach me:
- mail: pedja_stamenkovic@yahoo.com
- twiter: @Stamenkovic_P
#twindle
================================================
FILE: misc/firstpr/prem.md
================================================
Hi all, This is Prem (MrVoicer) from India. I create WordPress Website and Speed optimize them to load fast
================================================
FILE: misc/firstpr/proful.md
================================================
Proful Sadangi
From India, Living in Sydney
15 yr of developement experience
================================================
FILE: misc/firstpr/puru.md
================================================
Puru Vijay from Jaipur, Rajasthan, India. 5 years of experience.
Has worked in HTML, CSS, JS, StencilJS, React, Svelte, Angular.js, Angular, JQuery, Bootstrap, PHP, NodeJS, Python, Django, Firebase
================================================
FILE: misc/firstpr/rafael.md
================================================
I'm Rafael Rodrigues from Brazil. I'm a beginner in the programming world. I started to learn HTML+CSS+JavaScript about 5 months ago. I hope I can help and learn a lot in this project!
================================================
FILE: misc/firstpr/rajesh_prajapati.md
================================================
### Hi there 👋
- 🔭 I’m currently working on ...#React & #Flutter
- 🌱 I’m currently learning ...Javascript & Dart
- 👯 I’m looking to collaborate on ...Github People 👨🏻💻
- 🤔 I’m looking for help with ... space 🛰
- 💬 Ask me about ...#coding ✅
- 📫 How to reach me: ...@rkumar1904
- 😄 Pronouns: ...RjLooper
- ⚡ Fun fact: ...
My name is Saurabh Srivastava
B.TECH is CSE. Graduate of 2018. From India, Uttar Pradesh. Have 18 months Software Development Experience using LAMP Stack.
Know Front End Technologies like JavaScript, HTML5, CSS3 in moderation, enough to get the task done.
## **Skills**
* HTML5 & CSS3
* JavaScript, jQuery
* Basic Nodejs working
* PHP and MySQL
## **Contact me here**
Github | Twitter | LinkedIn
✉ vasudeveloper001@gmail.com
================================================
FILE: misc/firstpr/scott.md
================================================
I am Scott a frontend developer from johannesburg ,south africa.
i am self taught with some knowledge of css,html, javascript , python , and node js..
================================================
FILE: misc/firstpr/sheetal.md
================================================
### Hey there! :)
#### I am Sheetal Pandey, an engineering student from India.
I basically work with Python but I am also good with HTML5 and CSS3. Though I am yet to learn JavaScript.
Happy to collaborate and learn together.
================================================
FILE: misc/firstpr/shekharranjan.md
================================================
Shekhar Ranjan - Learning JavaScript and a beginner in GitHub. I have basic knowledge of Java and SQL.This is 2nd PR and I am doing this from GitHub Desktop.
================================================
FILE: misc/firstpr/simrin_joshi.md
================================================
I am a passionate professional focussed on full stack developement. I have 1.5 years of experience in Angular, HTML, CSS , JS, Java and MySQL. I am looking forward to actively contribute to Twindle.
================================================
FILE: misc/firstpr/sippeybro.md
================================================
Hi im sippey bro
================================================
FILE: misc/firstpr/sravan.md
================================================
sravan-html,css andjs enthusiast.Open to learn new things.
This is my second pr from my local machine....
================================================
FILE: misc/firstpr/sunny.md
================================================
### hey there
**second pr**
i am sunny, from India and a Engineering student..
and am very much comfortable in HTML, CSS and JavaScript.
And am currently Working on MERN Stack.
You can reach me out on @sunny_dev_01 is my twitter handle.!!!
================================================
FILE: misc/firstpr/suraj.md
================================================
### Hi folks, I'm Suraj! :sun_with_face:
I'm Tushar Kandpal 👨💻!
An Electrical Engineer from Uttarakhand, India. Also a beginner in Front-End field.
***
## **Skills**
* HTML, CSS, Java
* Familiar with JavaScript, C++, DS, MySql
* **Frameworks:** Bootstrap
* **Technologies:** Git, VS Code
***
## **Catch Me Here**
Github | Twitter | LinkedIn
✉ kandpal.tushar@gmail.com
================================================
FILE: misc/firstpr/varad.md
================================================
Varad Karpe from India
Recently graduated as a Computer Science Engineer
Experience:
I have worked on a few Java projects during my internships(2).
Skills:
Java, HTML, CSS, Python, Javascript, C, C++, SQL
================================================
FILE: misc/firstpr/vera_nkanmuo.md
================================================
Hi,I'm Chioma Vera Nkanmuo, Beginner Web developer from Nigeria with basic knowledge of HTML and CSS. I am currently in my penultimate level in university.
Aside from coding, I love to read alot.
FUN FACT: I am a fitness ethusiast.
I love to teach (because i believe in sharing knowlege, you gain knowlege), so you may reach out to me for help, and I will be delighed to help.
Connect with me: verachioma39@yahoo.com / verayahoo5@gmail.com
follow me instagram and twitter; @dev_chivee
================================================
FILE: misc/firstpr/vijaya.md
================================================
Vijaya Bhaskar from Hyderbad, India with 9 years of development experience.
This is a second pull request.
================================================
FILE: misc/firstpr/vipin.md
================================================
Hi i am vipin, A frontend developer from Punjab mostly working on react native trying to learn advance javascript and nodejs.

================================================
FILE: misc/firstpr/viraj_patil.md
================================================
** Second PR **
Hi, I'm Viraj Patil, with 9 years of experience in software development.
Currently working as fullstack developer.
Aside from coding, I love to read alot.
You can reach me out on:
e-mail: mr.virajpatil@gmail.com
twitter: @mr_viraj
================================================
FILE: misc/firstpr/wamuyuwanjohi
================================================
Wamuyu Wanjohi : Kenyan Junior Data NAalyst who enjoys a bit of DS
================================================
FILE: misc/firstpr/yash.md
================================================
Yash Gupta from India.
Web developer and currently in Final year of college.
Skill-HTML, CSS, Javascript, React, NodeJs.
My first pull request to twindle
================================================
FILE: misc/playground/cli/README.md
================================================
# Folder Naming Convention
> Place your code inside a folder
### Use dashes(-) as delimiters
### Use lowercase letters
### Create a readme file explaining the steps to run the code
================================================
FILE: misc/playground/cli/spike/HackerNews/code.js
================================================
const fetch = require("node-fetch");
async function searchFor(searchTerm) {
const queryResult = [];
const url = `http://hn.algolia.com/api/v1/search?query=${searchTerm}&tags=story`;
const response = await fetch(url);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const result = await response.json();
queryResult.push(result);
return queryResult[0].hits;
}
async function captureCommentsId(keyword) {
const elements = await searchFor(`${keyword}`);
const Time = [];
const Titles = [];
const Urls = [];
const StoryIds = [];
for (const [k] of elements.entries()) {
Time.push(elements[k].created_at);
Titles.push(elements[k].title);
Urls.push(elements[k].url);
StoryIds.push(elements[k].objectID);
}
return [Time, Titles, Urls, StoryIds];
}
async function searchForStoriesComments(keyword) {
const [Time, Titles, Urls, StoryId] = await captureCommentsId(`${keyword}`);
const commentsDump = [];
for (const [, value] of StoryId.entries()) {
const api = `https://hn.algolia.com/api/v1/search?tags=comment,story_${value}`;
const response = await fetch(api);
const Page = await response.json();
commentsDump.push(Page);
}
return [commentsDump, Titles, Urls, Time];
}
//searchForStoriesComments()
async function dumpEverything(keyword) {
const [comments, Titles, Urls, Time] = await searchForStoriesComments(
`${keyword}`
);
const commentsText = [];
for (const [, element] of comments.entries()) {
//console.log(`${id} and ${element}`)
const single = element.hits;
for (const [, val] of single.entries()) {
//console.log(`${key} and ${val}`)
let commentval = val.comment_text;
commentsText.push(commentval);
}
}
return [commentsText, Titles, Urls, Time];
}
//dumpEverything()
async function constructObjectArray(keyword) {
const [Comments, Titles, Urls, Time] = await dumpEverything(`${keyword}`);
const arrayOfStories = [];
for (let i = 0; i < Titles.length; i++) {
if (i != 0) {
spin(Comments, 20);
}
arrayOfStories.push({
Story: Titles[i],
Date: Time[i],
Website: Urls[i],
discussion: Comments.slice(0, 20),
});
}
//console.log(arrayOfStories);
return arrayOfStories;
}
//constructObjectArray();
function spin(array, window) {
const gone = array.splice(0, window);
return [...array, ...gone];
}
module.exports = { constructObjectArray };
================================================
FILE: misc/playground/cli/spike/HackerNews/code2.js
================================================
const fetch = require("node-fetch");
//only story ids
async function searchFor() {
const frontStoryIDs = [];
const url = `https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty`;
const response = await fetch(url);
const result = await response.json();
const sliced = result.slice(0, 4);
frontStoryIDs.push(sliced);
return frontStoryIDs;
}
//response from all storyids
async function StoriesOnFrontPage() {
const [frontStoryids] = await searchFor();
const StoryIDs = [];
const kidos = [];
const Title = [];
const Url = [];
const requests = frontStoryids.map((x) =>
fetch(`https://hacker-news.firebaseio.com/v0/item/${x}.json?print=pretty`)
);
const response = await Promise.all(requests);
const filter = await Promise.all(response.map((res) => res.json()));
for (const [k, v] of filter.entries()) {
StoryIDs.push(v.id);
kidos.push(v.kids);
Url.push(v.url);
Title.push(v.title);
}
return [StoryIDs, kidos, Title, Url];
}
//front comment +id with parentid=storyid
async function frontComments() {
const CommentsText = [];
const OwnId = []; //frontcomments own id
const ParentId = []; //or storyid
const Ownkids = []; //front comment kids
const kidolen = [];
const [, kidos, Title, Url] = await StoriesOnFrontPage();
const allkids = [].concat(...kidos);
const requests = allkids.map((x) =>
fetch(`https://hacker-news.firebaseio.com/v0/item/${x}.json?print=pretty`)
);
const response = await Promise.all(requests);
const filter = await Promise.all(response.map((res) => res.json()));
for (const [k, v] of filter.entries()) {
if (v.deleted !== true) {
CommentsText.push(v.text);
OwnId.push(v.id);
ParentId.push(v.parent);
Ownkids.push(v.kids);
} else {
OwnId.push(v.id);
ParentId.push(v.parent);
}
}
return [OwnId, ParentId, Ownkids, CommentsText, kidolen];
//OwnId:frontcomments own id
//ParentId:or storyid
//Ownkids:kids of front comment
}
//all frontend Comments are here in commentText();
async function midcomments() {
const [
OwnIdorSecondPartid,
firstparentid,
Ownkidsid,
,
] = await frontComments();
const subsequentComments = [];
const ourkids = [];
const subparentid = [];
const ownid2 = [];
//const Ownkidlen = [];
const furthercomments = [].concat(...Ownkidsid).filter((e) => e !== undefined);
//fetch childrens of first comment
const requests = furthercomments.map((x) =>
fetch(`https://hacker-news.firebaseio.com/v0/item/${x}.json?print=pretty`)
);
const response = await Promise.all(requests);
const filter = await Promise.all(response.map((res) => res.json()));
for (const [k, v] of filter.entries()) {
if (v === null) {
console.log("null val");
} else if (v.deleted !== true) {
subsequentComments.push(v.text);
ownid2.push(v.id);
subparentid.push(v.parent);
ourkids.push(v.kids);
} else {
console.log("undefined");
subparentid.push(v.parent)
ownid2.push(v.id)
}
//return [ourkids,subparentid,subsequentComments]
//subsequentcomments:childrens of front comments
//subparent:frontcomments
}
return [ownid2, ourkids, subparentid, subsequentComments];
}
midcomments();
async function lastlayercomments() {
const [, ourkids, ,] = await midcomments();
const lastlayerComments = [];
const ownid3 = [];
const ownparentid = [];
const secondlayer = [].concat(...ourkids).filter((e) => e !== undefined);
const requests = secondlayer.map((x) =>
fetch(`https://hacker-news.firebaseio.com/v0/item/${x}.json?print=pretty`)
);
const response = await Promise.all(requests);
const filter = await Promise.all(response.map((res) => res.json()));
for (const [k, v] of filter.entries()) {
lastlayerComments.push(v.text);
ownid3.push(v.id);
ownparentid.push(v.parent);
}
return [ownid3, ownparentid, lastlayerComments];
}
lastlayercomments();
async function constructObjectArray() {
const everything = [];
const [StoryIDs, , Title, Url] = await StoriesOnFrontPage();
const [OwnId, ParentId, , CommentsText] = await frontComments();
const [ownid2, , subparentid, subsequentComments] = await midcomments();
const [ownid3, ownparentid, lastlayerComments] = await lastlayercomments();
//StoryIDs==ParentId(parent of 1st level comments)
//Ownid(means 1st commment)==subparentid(parent of mid comments):means first comments are parent of midlevel ones
//ownid2(mid comment)==ownparentid(parent of last layer) :
//creating some key-value relationship between using parent and child ID
//to align comments
const objfirstlevel = {};
for (let i = 0; i < CommentsText.length; i++) {
objfirstlevel[CommentsText[i]] = ParentId[i];
}
const attachfisttomiddle = {};
for (let i = 0; i < OwnId.length; i++) {
attachfisttomiddle[OwnId[i]] = ownid2[i];
}
const objmidlevel = {};
for (let i = 0; i < subsequentComments.length; i++) {
objmidlevel[subsequentComments[i]] = subparentid[i];
}
const attachmidtolast = {};
for (let i = 0; i < ownid2.length; i++) {
attachmidtolast[ownid2[i]] = ownid3[i];
}
const objlastlevel = {};
for (let i = 0; i < lastlayerComments.length; i++) {
objlastlevel[lastlayerComments[i]] = ownparentid[i];
}
}
constructObjectArray();
================================================
FILE: misc/playground/cli/spike/HackerNews/mainindex.js
================================================
const { constructObjectArray } = require("./code");
const Renderer = require("./renderer");
async function news(keyword) {
const data = await constructObjectArray(`${keyword}`);
const outputFilePath = `${__dirname}/news.pdf`;
await Renderer.render(data, outputFilePath);
console.log(`your pdf saved to ${outputFilePath}`);
}
news("medicine");
================================================
FILE: misc/playground/cli/spike/HackerNews/renderer/index.js
================================================
//const { generateEpub } = require("./epub/index");
const { generatePDF } = require("./pdf");
//const spinner = require("../spinner");
const render = async (tweets, outputFilePath) => {
return generatePDF(tweets, outputFilePath);
/*case "epub":
return generateEpub(tweets, outputFilePath);*/
//default:
//spinner.fail("Error: This renderer is not implemented yet");
//console.error("Error: This renderer is not implemented yet");
};
module.exports = {
render,
};
================================================
FILE: misc/playground/cli/spike/HackerNews/renderer/pdf/createpdf.js
================================================
// @ts-check
const puppeteer = require("puppeteer");
function footerMarkup() {
return `
`;
}
/**
* Creates a pdf document from htmlContent and saves it to outputPath
* @param {string} outputPath
* @param {string} htmlContent
*/
async function createPdf(outputPath, htmlContent) {
try {
// launches a headless puppeteer browser instance and opens a new page
const browser = await puppeteer.launch({
args: ["--no-sandbox"],
headless: true,
});
const page = await browser.newPage();
// sets the html of the page to htmlContent argument
await page.setContent(htmlContent);
// Prints the html page to pdf document and saves it to given outputPath
await page.emulateMediaType("print");
await page.pdf({
path: outputPath,
format: "A5",
margin: {
bottom: 52, // minimum required for footer msg to display
left: 20,
right: 20,
top: 10,
},
printBackground: true,
displayHeaderFooter: true,
footerTemplate: footerMarkup(),
headerTemplate: "",
});
// Closing the puppeteer browser instance
await browser.close();
} catch (error) {
console.error(error);
}
}
module.exports = { createPdf };
================================================
FILE: misc/playground/cli/spike/HackerNews/renderer/pdf/index.js
================================================
const { renderTemplate } = require("../render-template");
const { createPdf } = require("./createpdf");
async function generatePDF(data, outputPath) {
const parameter ={Story: data};
// creates the html content
const htmlContent = await renderTemplate(
parameter,
"template"
);
// creates the pdf from html and saves it to Twindle.pdf
await createPdf(outputPath, htmlContent);
return;
}
//generatePDF()
module.exports = { generatePDF };
================================================
FILE: misc/playground/cli/spike/HackerNews/renderer/render-template.js
================================================
const { readFile, writeFile } = require("fs").promises;
const hbs = require("handlebars");
const { tmpdir } = require("os");
const { join } = require("path");
/**
* Renders the html template with the given data and returns the html string
* @param {CustomTweetsObject} data
* @param {string} templateName
*/
async function renderTemplate(data, templateName) {
const html = await readFile(`${__dirname}/template/${templateName}.hbs`, "utf-8");
// creates the Handlebars template object
const template = hbs.compile(html, {
strict: true,
});
// renders the html template with the given data
const rendered = template(data);
const tmpPath = join(tmpdir(), "hello.html");
await writeFile(tmpPath, rendered, "utf-8");
await writeFile(tmpdir() + "/x.json", JSON.stringify(data, null, 2), "utf-8");
console.log("rendered saved to ", tmpPath);
return rendered;
}
module.exports = { renderTemplate};
================================================
FILE: misc/playground/cli/spike/HackerNews/renderer/template/template.hbs
================================================
Lorem Ipsum dolor sit amet, consectetur adipsicing elite. Got it? Neither did we. In the publishing and design industries, “lorem ipsum” is used as dummy text in visual designs. Using placeholder copy like this helps designers and clients alike focus on layout, imagery, typography, and design rather than on the actual wording of content. Dummy copy is great, but what’s with all the Latin? Turns out, the original Lorem Ipsum comes from bits and pieces of Cicero’s De Finibus bonorum et Malorum (On the Ends of Goods and Evils).
` } ] }; export function generateEpub (directory) { return new epub(options, directory) } ================================================ FILE: misc/playground/cli/spike/cli-epub/index.js ================================================ import yargs from 'yargs'; import { hideBin } from 'yargs/helpers'; import { generateEpub } from "./epub.js"; const options = yargs(hideBin(process.argv)) .usage("Usage: -o
How to Get Rich (without getting lucky) in the world:
Seek wealth, not money or status. Wealth is having assets that earn while you sleep. Money is how we transfer time and wealth. Status is your place in the social hierarchy.
Understand that ethical wealth creation is possible. If you secretly despise wealth, it will elude you.
Ignore people playing status games. They gain status by attacking people playing wealth creation games.
{{createdAt}}
{{tweet}}
2018-05-31
How to Get Rich (without getting lucky):
2018-05-31
How to Get Rich (without getting lucky):
2018-05-31
How to Get Rich (without getting lucky):
{{createdAt}}
{{tweet}}
| Name | TwitterHandle | image | createdAt | tweet |
|---|
| Name | TwitterHandle | image | createdAt | tweet |
|---|
