Skip to content

Instantly share code, notes, and snippets.

Avatar

baptx

View GitHub Profile
@baptx
baptx / twitter_archive_to_csv.htm
Last active Aug 4, 2020
Twitter archive to CSV
View twitter_archive_to_csv.htm
<script>
// copy tweets variable from tweets.js file of your Twitter archive
var tweets = [];
// Open this HTML file and execute the following JavaScript code in the web console (F12 or Ctrl+Shift+K shortcut)
// A textarea will appear so you can copy/paste to save data as a CSV file
/*
var out = [];
var length = tweets.length;
for (var i = 0; i < length; ++i) {
@baptx
baptx / freelancer_country_filter.user.js
Last active Jul 1, 2020
freelancer.com country filter
View freelancer_country_filter.user.js
// ==UserScript==
// @name freelancer.com country filter
// @namespace https://drawcode.eu/
// @include https://www.freelancer.com/projects/*
// @version 1
// @grant none
// ==/UserScript==
// Commented script needs to run in web console on a job search page (e.g. in a separate Firefox profile to avoid new tab focus and tabs overflow)
// You need to be logged in because the logged out page is different and displays less jobs
@baptx
baptx / facebook_friends_people_search_backup.js
Last active Jul 9, 2020
Facebook friends / people search backup in web browser
View facebook_friends_people_search_backup.js
/* Facebook friends / people search backup in web browser
* Scroll down to your friends page or a people search page to load all profiles
* Copy-paste the script below in a web browser console (F12 key or Ctrl+Shift+K shortcut in a browser like Firefox) and execute the desired function
* A textarea will appear at the end of the page so you can copy the data and paste it in a text file before saving it as a CSV file
* You can then view your backup in a spreadsheet editor like LibreOffice Calc
* You can also compare the backup with another one to see who removed you from their friends list or who appeared in a new search (e.g. with the Linux diff command)
* If the friend changed their name or profile URL, you can still find them with their profile ID which is backed up in the last column (open facebook.com/PROFILE_ID in a web browser)
* The Facebook Graph API was not used because they are locking or deprecating most of their endpoints (e.g. https://developers.facebook.com/docs/graph-api/changelog/breakin
@baptx
baptx / instagram-api_send_message.js
Last active Jun 4, 2020
Instagram API: send direct messages from a web browser
View instagram-api_send_message.js
/*
Instagram API: send direct messages from a web browser
For browser setup, see script instagram-api_direct_messages_backup.js
Instagram web version sessionid cookie does not allow sending messages so we need to log in manually
Signature should match signed_body data (using HMAC-SHA256 with private key) but wrong signature or key may work also.
You don't need to get the private key yourself since people already got it but here are interesting links explaining how to get it:
https://eliasbagley.github.io/reverseengineering/2016/12/02/reverse-engineering-instagram-api.html
http://www.will3942.com/reverse-engineering-instagram
@baptx
baptx / instagram-api_direct_messages_backup.js
Last active Nov 2, 2020
Instagram API: view and backup direct messages from a web browser
View instagram-api_direct_messages_backup.js
/*
Instagram API: view and backup direct messages from a web browser
1) Log in on Instagram web version and go to your profile page
(the home page will not work because it loads data when scrolling down and the direct messages will be displayed at the bottom of the page)
2) Modify HTTP headers with a browser addon like Header Editor (https://addons.mozilla.org/en-US/firefox/addon/header-editor/)
Content-Security-Policy (response header on domain www.instagram.com): original data with https://i.instagram.com/ added to connect-src
report-uri https://www.instagram.com/security/csp_report/; default-src 'self' https://www.instagram.com; img-src https: data: blob:; font-src https: data:; media-src 'self' blob: https://www.instagram.com https://*.cdninstagram.com https://*.fbcdn.net; manifest-src 'self' https://www.instagram.com; script-src 'self' https://instagram.com https://www.instagram.com https://*.www.instagram.com https://*.cdninstagram.com wss://www.instagram.com https://*.facebook.com https://*.fbcdn.ne
@baptx
baptx / facebook_graph_api.js
Last active Apr 30, 2018
Facebook Graph API groups members intersection
View facebook_graph_api.js
/*
* config
*/
var token = "XXX";
var limit = 5000;
var id1 = "XXX";
var id2 = "XXX";
@baptx
baptx / francetv_get_m3u8.user.js
Last active Apr 30, 2018
Get M3U8 streaming URL from France TV info replay website
View francetv_get_m3u8.user.js
// ==UserScript==
// @name get_m3u8
// @namespace francetvinfo
// @include http://www.francetvinfo.fr/*
// @version 1
// @grant none
// ==/UserScript==
/* Using Content Script Injection (window.functionName) to make function available outside GreaseMonkey scope
Page reload is needed if using existing function _jsonp_loader_callback_request_0. */
@baptx
baptx / 2letters_domains_available.node.js
Last active Apr 30, 2018
List available 2 letters domain names in JavaScript using Node.js / JXcore
View 2letters_domains_available.node.js
var https = require("https");
var fs = require("fs");
var ws = fs.createWriteStream("2letters_domains_available.txt");
var domain = "aa.lc"; // format: aa.tld
var numbers = false; // include numbers
function apiParse(body)
{
var status = JSON.parse(body)[0].available;
@baptx
baptx / twitter_api_1.1_backup.js
Last active Nov 21, 2020
Twitter API 1.1 tweets / favorites (likes) / following / followers backup in web browser
View twitter_api_1.1_backup.js
/* Twitter API 1.1 tweets / favorites (likes) / following / followers backup in web browser
* Get your access keys to use Twitter API 1.1: https://dev.twitter.com/docs/auth/tokens-devtwittercom
* You can change Twitter API URL and Twitter screen_name, then execute script from a trusted web page without CSP protection like about:blank in a web browser console (F12 or Ctrl+Shift+K shortcut)
* A textarea will appear so you can copy/paste to save data as a CSV file or search tweets / users in your web browser (Ctrl+F shortcut)
* You can then view your backup in a spreadsheet editor like LibreOffice Calc
* You can also compare the backup with another one to see who unfollowed you, who changed their Twitter username by looking at the user ID or which tweet you retweeted / favorited was deleted (e.g. with the Linux diff command)
*
* Note about the tweets backup:
* Usually you will search tweets that you retweeted using Twitter web version (https://twitter.com/search) with a search like "from:your_username f
@baptx
baptx / twitter_api_1.1.js
Last active Feb 4, 2020
Access Twitter API 1.1 in web browser
View twitter_api_1.1.js
/* Access Twitter API 1.1 in browser.
** Get your access keys to use Twitter API 1.1: https://dev.twitter.com/docs/auth/tokens-devtwittercom
** Format JSON in Firefox: https://addons.mozilla.org/EN-us/firefox/addon/jsonview/
** You can change Twitter API URL and Twitter screen_name, then execute script from a trusted web page without CSP protection like about:blank in Firefox Scratchpad or any other browser console.
*/
var script = document.createElement("script");
script.setAttribute("src", "https://pastebin.com/raw/HFjqYLdG"); // http://oauth.googlecode.com/svn/code/javascript/oauth.js (down)
document.body.appendChild(script);
You can’t perform that action at this time.