Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial is confusing #81

Open
JamesDelaneyyy opened this issue Nov 18, 2024 · 1 comment
Open

Tutorial is confusing #81

JamesDelaneyyy opened this issue Nov 18, 2024 · 1 comment

Comments

@JamesDelaneyyy
Copy link

Tried following the video tutorial, but it's in french.
Tried following the text tutorial, but it's not explained well enough.

"Now replace the values in the .js from this repository of the according variables, by the values of the three variables you found, here is an example of how it should look in the end : "

This means nothing to me, since I don't know anything about java or any sort of script editing. Please make it more user friendly.

@trainerkelly
Copy link

trainerkelly commented Nov 18, 2024

Hey there!! Hopefully I can help you with this. At least a little bit.

I'll be providing a bit of extra context as well to (hopefully) make it easier to understand.

Since it sounds like you don't program, I recommend opening up a plain text file (Notepad on Windows (or Notepad++ which is for programming) or TextEdit on Mac should be fine. If you want to get a bit fancier, you can download VS Code) and either copying the code (in main.js) from the repository into the document to make it easier to edit OR downloading the code and opening up the main.js file into your editor.

In JavaScript (the programming language used – it's available on all web browsers), a variable just holds data. It's like a box with a label on it and the variable name is that label.

In the case of this script, there are four spots you want to update the data inside of the variable:

var authorization = "Bearer ***";
var client_tid = "***"; // replace by X-Client-Transaction-Id value
var client_uuid = "***"; // replace by X-Client-Uuid value
var username = "YourUsernameHere" // replace with your username

The "var" is just a type of keyword that tells the browser "hey, this is the name of this variable, so when I use this name in the code, use the data stored in here". You'll want to replace the *** with data that you get from the developer tools in your browser.

Right click in your browser and hit "Inspect" to bring up the Developer Tools. If you look towards the top of the developer tools, you'll see a series of small tabs. You want to click the "Network" one. Then you'll want to hit the button that says "XHR" (Firefox) / "Fetch/XHR" (Chrome). It'll bring up a list of connections that the site is bringing up over the network. I recommend using the filter in the Network tab to search for all.json (which is the one the example uses). Click it. Another panel should open up displaying a bunch of data.

スクリーンショット 2024-11-18 11 58 50

In this second panel/section staying on the first tab (where it says "Headers"), scroll down to the "Request Headers" section. Scroll down to where it says "Authorization". Copy the info in the second column. You can leave out the keyword "Bearer" when you copy it because it's already inside of the string (collection of characters) inside of the variable.

If you scroll down a bit further, you will see the X-Client-Transaction-Id and the X-Client-Uuid sections. Copy and paste the info in the second column inside of the variable where the *** is.

Then lastly add your username.

Make sure you leave the the quotation marks!! It tells the browser what kind of data type it is (in this case, these are strings). The code won't run properly if you remove them.

Once that's done, check over the other options inside of the delete_options variable and see if you want any of them enabled / disabled. (If you want it enabled, use the keyword true (without quotations), otherwise use the keyword false. They're a data type called a boolean and it's basically yes / no lol.) It looks like the Lyfhael put some detailed explanations inside the code (between the /* */) for each section. I recommend reading them to see what you would like to enable.

(I personally enabled the from_archive because I downloaded my archive, as well as set my before & after dates under the old_tweets section.)

Once you're done, copy the code in its entirety. Inside of the developer tools while on X / Twitter, hit the "Console" tab and paste the code. Hit enter. The code should successfully run – all you'll need to do is wait.

(I found the code does not run in Firefox, but appears to work fine in Chrome.)

I hope this helps a bit. I know code can be confusing, especially if you don't know how to do it. 😅 Maybe someone will fork this and make a plugin or something at some point that is more user-friendly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants