twindle-co / twindle

Twindle - an open source project for beginners. Converting twitter threads to pdf, epub, and mobi format to be read by Kindle.
https://www.twindle.co
MIT License
134 stars 133 forks source link

Run CLI and post mock data here #815

Closed PuruVJ closed 3 years ago

PuruVJ commented 3 years ago

When many people are working on same codebase, things break unexpectedly. To prevent this scenario, we need to have robust tests in place. And for robust testing, we need a very high quantity of data.

We need very diverse type of data, and for that, we's need everyone's contribution.

How can I help

It is very easy.

Run the commands as you regularly do, just add --generate-mock.

e.g.

Go to twindle-cli folder, run following command(replace <TWEET ID *> with the tweet IDs)

node . -i <TWEET ID 1>,<TWEET ID 2>,<TWEET ID 3>,<...> --generate-mock

A real command

 node . -i 1326680823559380992,1325817877585387521 --generate-mock

This will generate a generated-mock/@CUSTOM-OUTPUT_* file in the twindle-cli folder.

Copy its contents and paste them here with the following template:


Command: <COMMAND ENTERED(e.g. node . -i <IDS> --generated-mock>

```json Paste your content here ```


That's all ๐Ÿ˜Š

PuruVJ commented 3 years ago

Here's the first one from me

Command: node . -i 1321111764851920902,1259539005097426944 -o david-perell --generate-mock

https://gist.github.com/proful/b3b3a07368e4dd26283e5abb7f64feee

praveen2896 commented 3 years ago

Here' the mine , node . -i 1327487313706774528 -o paridas --generate-mock

[
  {
    "common": {
      "created_at": "Nov 14, 2020",
      "user": {
        "name": "Trilochan Parida โ˜๏ธ๐Ÿš€",
        "id": "972125588",
        "verified": false,
        "location": "Bengaluru, India",
        "protected": false,
        "profile_image_url": "https://pbs.twimg.com/profile_images/1254046674927960065/KRgGGCrw.jpg",
        "pinned_tweet_id": "1300298649067429888",
        "public_metrics": {
          "followers_count": 6443,
          "following_count": 86,
          "tweet_count": 2150,
          "listed_count": 96
        },
        "username": "@TechParida",
        "url": "https://t.co/X8m1dlBJLP",
        "description": "AWS certified. PHP, Python<img class=\"emoji\" draggable=\"false\" alt=\"๐Ÿ\" src=\"https://twemoji.maxcdn.com/v/13.0.1/svg/1f40d.svg\"/>, Cloud. Online educator (YouTube)<br /><br /><img class=\"emoji\" draggable=\"false\" alt=\"๐Ÿ‘‹๐Ÿป\" src=\"https://twemoji.maxcdn.com/v/13.0.1/svg/1f44b-1f3fb.svg\"/> Hello, World!<br />Let's Learn Together.",
        "entities": {
          "url": {
            "urls": [
              {
                "start": 0,
                "end": 23,
                "url": "https://t.co/X8m1dlBJLP",
                "expanded_url": "https://www.youtube.com/c/codingx",
                "display_url": "youtube.com/c/codingx"
              }
            ]
          }
        },
        "created_at": "2012-11-26T15:03:40.000Z"
      },
      "count": 7
    },
    "data": [
      {
        "id": "1327487313706774528",
        "created_at": "Nov 14, 2020",
        "tweet": "5 FREE ONLINE COURSES FOR YOU TO LEARN UI/UX<br /><br />You will love this <img class=\"emoji\" draggable=\"false\" alt=\"๐Ÿงต\" src=\"https://twemoji.maxcdn.com/v/13.0.1/svg/1f9f5.svg\"/>"
      },
      {
        "id": "1327487315506130945",
        "created_at": "Nov 14, 2020",
        "tweet": "1. Product Design - Udacity<br /><br /><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://www.udacity.com/course/product-design--ud509\">https://www.udacity.com/course/product-design--ud509</a>"
      },
      {
        "id": "1327487317779439616",
        "created_at": "Nov 14, 2020",
        "tweet": "2. Introduction to User Experience Design - Coursera<br /><br /><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://www.coursera.org/learn/user-experience-design\">https://www.coursera.org/learn/user-experience-design</a>"
      },
      {
        "id": "1327487320585502726",
        "created_at": "Nov 14, 2020",
        "tweet": "3. UX Fundamentals - Gymnasium<br /><br /><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://thegymnasium.com/courses/GYM/103/0/about\">https://thegymnasium.com/courses/GYM/103/0/about</a>"
      },
      {
        "id": "1327487322477129728",
        "created_at": "Nov 14, 2020",
        "tweet": "4. UI, UX and Design Tool Courses - Learnux .in<br /><br /><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://learnux.io\">https://learnux.io</a>"
      },
      {
        "id": "1327487325417451521",
        "created_at": "Nov 14, 2020",
        "tweet": "5. Digital Skills: User Experience Course - Future Learn<br /><br /><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://www.futurelearn.com/courses/digital-skills-user-experience\">https://www.futurelearn.com/courses/digital-skills-user-experience</a>"
      },
      {
        "id": "1327487327925485568",
        "created_at": "Nov 14, 2020",
        "tweet": "I hope you found this post helpful. <br /><br />Happy Learning<img class=\"emoji\" draggable=\"false\" alt=\"๐Ÿ’•\" src=\"https://twemoji.maxcdn.com/v/13.0.1/svg/1f495.svg\"/>"
      }
    ]
  }
]
SarveshKadam commented 3 years ago

Here's mine command: node . -i 1325041236399456257,1323861791877685248 --generate-mock

Output https://gist.github.com/SarveshKadam/263d3ffe6f37583ec8a84e4967272e96

Mira-Alf commented 3 years ago

Here is my command: node . -i 1328598038206615552,1328628445748879360,1328466921633710081,1328459837735362563,1328375841680658433 --generate-mock -o mira

Here is my gist containing the json response: output json

EYRAM565 commented 3 years ago

node . -i 1328375452554178561,1328467988035473408 --generate-mock [ { "common": { "created_at": "Nov 16, 2020", "user": { "name": "Danny Thompson", "verified": false, "username": "@DThompsonDev", "pinned_tweet_id": "1320344054324920320", "location": "Memphis, TN", "description": "Changing mindsets |
Software Developer|
Meetup Organizer/Founder|
Twitter Course <a href=\"http://gumroad.com/l/KFkhUc\" class=\"description-link\" rel=\"noopener noreferrer\">gumroad.com/l/KFkhUc
My Youtube Channel! <a href=\"http://youtube.com/DThompsonDev\" class=\"description-link\" rel=\"noopener noreferrer\">youtube.com/DThompsonDev", "created_at": "2019-01-16T10:01:39.000Z", "url": "https://t.co/nb8h10dJea", "profile_image_url": "https://pbs.twimg.com/profile_images/1222136283339853833/dr25E9Lk.jpg", "protected": false, "public_metrics": { "followers_count": 52582, "following_count": 3696, "tweet_count": 20324, "listed_count": 418 }, "entities": { "url": { "urls": [ { "start": 0, "end": 23, "url": "https://t.co/nb8h10dJea", "expanded_url": "http://discord.gg/D453pGe", "display_url": "discord.gg/D453pGe" } ] }, "description": { "urls": [ { "start": 81, "end": 104, "url": "https://t.co/0SDl5CXMDn", "expanded_url": "http://gumroad.com/l/KFkhUc", "display_url": "gumroad.com/l/KFkhUc" }, { "start": 125, "end": 148, "url": "https://t.co/tBboynMp4a", "expanded_url": "http://youtube.com/DThompsonDev", "display_url": "youtube.com/DThompsonDev" } ] } }, "id": "1085477171055996928" }, "count": 5 }, "data": [ { "id": "1328375452554178561", "created_at": "Nov 16, 2020", "tweet": "ALGORITHM PRACTICE!

Danny likes to drink water while working out.
I drink 0.5 liters/hour of working out.
If I give you the HOURS you should be able to figure out the liters rounded down to the nearest whole number.

If time = 3 hours should be 1 liter
time = 6.5 hours 3 liters." }, { "id": "1328375453795672066", "created_at": "Nov 16, 2020", "tweet": "Don't look at the solutions, it is PERFECTLY OK TO BE WRONG! Just try & see!

Let your brain work before seeing an answer. It will absorb the correct answer better than if you just look at the answer. Trust me, it works!

Subscribe to my youtube channel!
", "linkWithImage": { "expanded_url": "http://youtube.com/DThompsonDev", "images": [ { "url": "https://pbs.twimg.com/news_img/1328477107308081153/eCcrOHxK?format=jpg&name=orig", "width": 900, "height": 900 }, { "url": "https://pbs.twimg.com/news_img/1328477107308081153/eCcrOHxK?format=jpg&name=150x150", "width": 150, "height": 150 } ], "title": "DThompsonDev", "description": "Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.", "domain": "www.youtube.com" } }, { "id": "1328377688915120132", "created_at": "Nov 16, 2020", "tweet": "SPOILER!
SPOILER!
SPOILER!
SPOILER!
SPOILER!
THIS IS THE ANSWER! Try to answer it first!

SPOILER!
SPOILER!
.
.
.
.
the solution I came up with

liter = Math.floor(time * 0.5)
Math.floor will round the value down.
We know liter is 0.5/hour so multiplying makes sense!" }, { "id": "1328379188332650498", "created_at": "Nov 16, 2020", "tweet": "let me know if this helps. I have started focusing on getting stronger on my algos and DS. So I thought this could be a good way to have everyone practice and learn together.

If this helps you, to ask the question and then explain it, let me know and I will make these regularly." }, { "id": "1328416309583998982", "created_at": "Nov 16, 2020", "tweet": "I had a bit of time so I made this into a codepen that works. showing you how to use this algorithm in HTML,CSS and JS.

hope this helps and brings everything together!

", "linkWithImage": { "expanded_url": "https://codepen.io/dannythompson901/pen/mdEopZP?editors=1010", "images": [ { "url": "https://pbs.twimg.com/news_img/1328415653443874816/_N4dFLMk?format=jpg&name=orig", "width": 1279, "height": 720 }, { "url": "https://pbs.twimg.com/news_img/1328415653443874816/_N4dFLMk?format=jpg&name=150x150", "width": 150, "height": 150 } ], "title": "HydrationCalculator", "description": "...", "domain": "codepen.io" } } ] }, { "common": { "created_at": "Nov 16, 2020", "user": { "name": "Nicholas Carrigan (he/him)", "verified": false, "username": "@nhcarrigan", "pinned_tweet_id": "1319441127963906048", "location": "Washington, USA", "description": "I'm an open sourcerer.", "created_at": "2020-05-16T20:45:58.000Z", "url": "https://t.co/KB4pXiTB6S", "profile_image_url": "https://pbs.twimg.com/profile_images/1322942822496968704/6upNjLnY.jpg", "protected": false, "public_metrics": { "followers_count": 91, "following_count": 78, "tweet_count": 323, "listed_count": 0 }, "entities": { "url": { "urls": [ { "start": 0, "end": 23, "url": "https://t.co/KB4pXiTB6S", "expanded_url": "https://www.nhcarrigan.com", "display_url": "nhcarrigan.com" } ] } }, "id": "1261759785344499712" }, "count": 5 }, "data": [ { "id": "1328467988035473408", "created_at": "Nov 16, 2020", "tweet": "<a href=\"https://twitter.com/hashtag/100DaysOfCode\">#100DaysOfCode R2D19: Felt like a very busy morning! Juggling three different things at once, and had to prioritise which would get handled first. Because it is Monday, started with my weekly job search. Redesigned my LinkedIn based on <a href=\"https://twitter.com/DThompsonDev\">@DThompsonDev's videos - hope this helps!" }, { "id": "1328467989050449920", "created_at": "Nov 16, 2020", "tweet": "Tweaked my resume - switching from a two-column layout to a one-column layout for easier ATS reading. Gotta get past those bots! Fired off 10 job applications. I'd do more, but I've got a bunch of other things to tackle today and there weren't many openings I am qualified for..." }, { "id": "1328467990052958208", "created_at": "Nov 16, 2020", "tweet": "Started work on a PR to replace some outdated assets on the freeCodeCamp design style guide, only to realise that there was a different planned approach there. Held on to my PR and inquired about the plan. The great thing about version control: You can save changes to a branch!" }, { "id": "1328467990988263424", "created_at": "Nov 16, 2020", "tweet": "Helped again on the <a href=\"https://twitter.com/eddiejaoude\">@eddiejaoude bot PR. Always cool to watch the community come together for improving a new feature. Then submitted my own PR to add a pre-commit linting step. This ensures that commits will not fail the lint CI, which should facilitate smoother contributing!" }, { "id": "1328467991932018688", "created_at": "Nov 16, 2020", "tweet": "Made a custom background for my portfolio page (nothing fancy, I'm not an artist), uploaded my revised resume, and tweaked some styling. I think that'll wrap it up for today, unless anything hits my notifications." } ] } ]

naomi-lgbt commented 3 years ago

Hello~! Why did I get pinged here? ๐Ÿค”

PuruVJ commented 3 years ago

The above tweet data is from a user whose twitter handle is same as yours @nhcarrigan. Please mute it.

naomi-lgbt commented 3 years ago

Those are actually my tweets ๐Ÿ˜…

johnjacobkenny commented 3 years ago

@nhcarrigan hope it was a good use of your time to be brought here :heart:

Akshay2996 commented 3 years ago

Here's my example of --generate-mock. Command: node . -i 1318412529681362944 --generate-mock Tweet by @PrathamKumar14

[
  {
    "data": [
      {
        "id": "1318412529681362944",
        "tweet": "Best Front-end Development Tools that you should try<img class=\"emoji\" draggable=\"false\" alt=\"๐Ÿ‘‡๐Ÿป\" src=\"https://twemoji.maxcdn.com/v/13.0.1/svg/1f447-1f3fb.svg\"/><br /><br />{Thread<img class=\"emoji\" draggable=\"false\" alt=\"๐Ÿงต\" src=\"https://twemoji.maxcdn.com/v/13.0.1/svg/1f9f5.svg\"/>}"
      },
      {
        "id": "1318412531300397056",
        "tweet": "<img class=\"emoji\" draggable=\"false\" alt=\"๐Ÿ“Œ\" src=\"https://twemoji.maxcdn.com/v/13.0.1/svg/1f4cc.svg\"/> Creative Timย provides Bootstrap based design elements, which help you faster your development work<br /><br /><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://www.creative-tim.com/\">https://www.creative-tim.com/</a>"
      },
      {
        "id": "1318412533301084161",
        "tweet": "<img class=\"emoji\" draggable=\"false\" alt=\"๐Ÿ“Œ\" src=\"https://twemoji.maxcdn.com/v/13.0.1/svg/1f4cc.svg\"/> Everything you need for your creative projects<br />Unlimited downloads of 53+ million creative assets. All for one low cost.<br /><br /><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://elements.envato.com/\">https://elements.envato.com/</a>"
      },
      {
        "id": "1318412537117863936",
        "tweet": "<img class=\"emoji\" draggable=\"false\" alt=\"๐Ÿ“Œ\" src=\"https://twemoji.maxcdn.com/v/13.0.1/svg/1f4cc.svg\"/> Codekitย is a front-end web development tool. This tool provides support to build websites faster.<br /><br /><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://codekitapp.com/\">https://codekitapp.com/</a>"
      },
      {
        "id": "1318412539131162624",
        "tweet": "<img class=\"emoji\" draggable=\"false\" alt=\"๐Ÿ“Œ\" src=\"https://twemoji.maxcdn.com/v/13.0.1/svg/1f4cc.svg\"/> WebStormย brings smart coding assistance for JavaScript. It provides advanced coding assistance for Angular, React.js, Vue.js and Meteo<br /> <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://www.jetbrains.com/webstorm/\">https://www.jetbrains.com/webstorm/</a>"
      },
      {
        "id": "1318412540993392642",
        "tweet": "<img class=\"emoji\" draggable=\"false\" alt=\"๐Ÿ“Œ\" src=\"https://twemoji.maxcdn.com/v/13.0.1/svg/1f4cc.svg\"/> Gruntย is a popular task runner on NodeJS. It is flexible and widely adopted.<br /><br /><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://gruntjs.com/\">https://gruntjs.com/</a>"
      },
      {
        "id": "1318412542968881152",
        "tweet": "<img class=\"emoji\" draggable=\"false\" alt=\"๐Ÿ“Œ\" src=\"https://twemoji.maxcdn.com/v/13.0.1/svg/1f4cc.svg\"/> Grid guideย is another important front end development tool. It allows creating pixel perfect grids within designs.<br /><br /><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://guideguide.me/\">https://guideguide.me/</a>"
      }
    ],
    "common": {
      "created_at": "Oct 20, 2020",
      "user": {
        "name": "Pratham ๐Ÿ‘จโ€๐Ÿ’ป๐Ÿš€",
        "id": "856155592578158592",
        "verified": false,
        "location": "India ๐Ÿ‡ฎ๐Ÿ‡ณ",
        "protected": false,
        "profile_image_url": "https://pbs.twimg.com/profile_images/1297580794479812611/0Ew8BRs0.jpg",
        "pinned_tweet_id": "1302898895157108736",
        "public_metrics": {
          "followers_count": 14489,
          "following_count": 778,
          "tweet_count": 7853,
          "listed_count": 152
        },
        "username": "Prathkum",
        "url": "https://t.co/SO1DmF1ryM",
        "description": "Front-end Enthusiast<img class=\"emoji\" draggable=\"false\" alt=\"โ˜˜๏ธ\" src=\"https://twemoji.maxcdn.com/v/13.0.1/svg/2618.svg\"/> || CSS writer<img class=\"emoji\" draggable=\"false\" alt=\"๐ŸŒˆ\" src=\"https://twemoji.maxcdn.com/v/13.0.1/svg/1f308.svg\"/> || JavaScript and React lover<img class=\"emoji\" draggable=\"false\" alt=\"๐Ÿ’›\" src=\"https://twemoji.maxcdn.com/v/13.0.1/svg/1f49b.svg\"/> || Explorer<img class=\"emoji\" draggable=\"false\" alt=\"๐Ÿ”Ž\" src=\"https://twemoji.maxcdn.com/v/13.0.1/svg/1f50e.svg\"/> || Chess player<img class=\"emoji\" draggable=\"false\" alt=\"โ™Ÿ๏ธ\" src=\"https://twemoji.maxcdn.com/v/13.0.1/svg/265f.svg\"/> || Currently obsessed with creating Twitter headers<img class=\"emoji\" draggable=\"false\" alt=\"โœจ\" src=\"https://twemoji.maxcdn.com/v/13.0.1/svg/2728.svg\"/>",
        "entities": {
          "url": {
            "urls": [
              {
                "start": 0,
                "end": 23,
                "url": "https://t.co/SO1DmF1ryM",
                "expanded_url": "http://pratham.codes",
                "display_url": "pratham.codes"
              }
            ]
          }
        },
        "created_at": "2017-04-23T14:39:34.000Z"
      },
      "count": 7
    }
  }
]
PuruVJ commented 3 years ago

Most data submitted here is irrelevant now due to the heavy structural changes. We need to find all permutations of threads and commands and document them. Then anyone can keep that data in sync by referring to that list.