Skip to content

Instantly share code, notes, and snippets.

@ntrzz
Last active January 21, 2023 10:12
Show Gist options
  • Save ntrzz/bc8190a21a1324f5ad34d13b1ac4ccfa to your computer and use it in GitHub Desktop.
Save ntrzz/bc8190a21a1324f5ad34d13b1ac4ccfa to your computer and use it in GitHub Desktop.
curl -s $1 | grep -Eo "(http|https)://[a-zA-Z0-9./?=_-]*" | sort | uniq | grep ".js" > jslinks.txt; while IFS= read link; do python linkfinder.py -i "$link" -o cli; done < jslinks.txt | grep $2 | grep -v $3 | sort -n | uniq; rm -rf jslinks.txt
@ntrzz
Copy link
Author

ntrzz commented Jun 15, 2018

This is a simple oneliner for getting paths in js files gathered from source-code using Linkfinder.
Note This script must be in root directory of linkfinder.
Note 2 This works if .js files are imported as absolute paths and not relative paths.

Installation:

chmod +x linkfinder-onliner.sh
./linkfinder-onliner.sh https://twitter.com $1 $2

Where

  • $1 is what you want to see in output (for example, http://, https://, /api, .pdf, .php etc.)
  • $2 what you do not want to see in output (usually it is ./)

Example:

./linkfinder-oneliner.sh https://twitter.com "/" "https://" // output all paths found, but don't print https:// links found

./linkfinder-oneliner.sh https://twitter.com "/" "https://"
./above_timeline_prompt.mustache
./account_health_prompt.mustache
...
/i/promoted_content/log.json
/i/push_destinations
/i/push_destinations/destroy
/i/safety/report_story?
...
http://get.adobe.com/flashplayer
http://www.w3.org/TR/SVG11/feature#Image

./linkfinder-oneliner.sh https://twitter.com "https://" " " // output all https links found

./linkfinder-oneliner.sh https://twitter.com "https://" " "
https://abs.twimg.com/hashflags/
https://abs.twimg.com/k/fr/
https://analytics.twitter.com/tpm/p
https://api.twitter.com
https://api.twitter.com/1.1/account/verify_credentials.json
https://api.twitter.com/1.1/dm/conversation/
https://api.twitter.com/1.1/dm/subscriptions/destroy.json
https://api.twitter.com/1.1/dm/subscriptions/new.json
https://api.twitter.com/1.1/dm/update_last_seen_event_id.json
https://api.twitter.com/2/follow_search/create.json
https://api.twitter.com/2/follow_search/destroy.json
https://api.twitter.com/2/follow_search/show.json
https://api.twitter.com/live_pipeline/events
https://business.twitter.com/help/how-twitter-ads-work
https://localhost.twitter.com
https://support.twitter.com/articles/
https://support.twitter.com/articles/20171399
https://support.twitter.com/articles/20172128#import-web
https://support.twitter.com/articles/66885
https://syndication.twitter.com/i/jot/syndication
https://t.co/
https://twitter.com
https://twitter.com/
https://twitter.com/rules
https://twitter.com/search?q=%23
https://twitter.com/search?q=%24
https://upload.twitter.com/i/media/metadata/create.json
https://upload.twitter.com/i/media/upload.json
https://www.snappytv.com/tc/$1?autoplay=true&amp;h=

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment