News for hackers. Stuff that matters.
Re:“Starting February 9, we will no longer support free acce... by krageon on Thursday February 02, 2023 @03:25AM (#34623766)
It's simple: Use the website. It will never stop working because people use it and you can automate and scrape it just fine. Kind of sucks that you have to go through the effort - but then there is no social media corporation that isn't toxic in some way to it's userbase.
Re:“Starting February 9, we will no longer support free acce... by anigbrowl on Thursday February 02, 2023 @03:36AM (#34623823)
I actually don't mind scraping it that much, and even enjoy the adversarial aspects of writing scrapers. but it makes a lot of high level functionality like filtered streams or historical search much less accessible; I'd probably never have learned a lot of network analysis stuff over the last decade or so if I'd had to to pay to access streaming data first. Also, I think it's going to be harder for academic researchers to get institutional approval to scrape adversarially, so it could put a dent in a lot of social science research by forcing people to chase grants instead of focusing on their code.
Re:“Starting February 9, we will no longer support free acce... by rkagerer on Friday February 03, 2023 @04:25AM (#34639091)
It's ironic, for a couple (non-Twitter) projects I wound up scraping because either a) they didn't have an API yet (e.g. early crypto pricing sites) or b) I wasn't confident the API would remain intact over the long term. Kind of depressing.
Re:“Starting February 9, we will no longer support free acce... by geraldwhen on Friday February 03, 2023 @11:23AM (#34643240)
Also quality residential proxies are pricey. You need to rate limit and rotate both IP and puppeteer fingerprint when adversarially scraping.
Re:“Starting February 9, we will no longer support free acce... by mindslight on Friday February 03, 2023 @06:15PM (#34649195)
> I think it's going to be harder for academic researchers to get institutional approval to scrape adversarially

This is a good point about what might happen, but it seems worthwhile to address and fix directly. Personally I don't see why adversarial scraping of a publicly published website should require any more ethical consideration/review than using the suggested API would. Ethical concerns should revolve around humans, not the business desires of non-human entities.

Re:“Starting February 9, we will no longer support free acce... by olliej on Thursday February 02, 2023 @04:18AM (#34624144)
IIRC the twitter website goes to great lengths to mangle itself to prevent ad blockers presumably.

Of course this used to have the side effect of breaking significant swathes of basic browser UX, especially in areas of accessibility. I assume they’re better now than they once were, but given musk’s historical behavior I assume he won’t consider breaking something like accessibility to be bad or problematic.

Re:“Starting February 9, we will no longer support free acce... by dzhiurgis on Thursday February 02, 2023 @06:23AM (#34625099)
> musk’s historical behavior I assume he won’t consider breaking something like accessibility to be bad or problematic.

I don't see why would he spend more to make website less accessible. Not fixing bugs - yes, just about everyone does so. But breaking it intentionally costs money.

Tesla's aren't THE most accessible (by cost) EV out there, but SpaceX def is.

Re:“Starting February 9, we will no longer support free acce... by optionalsquid on Thursday February 02, 2023 @06:57AM (#34625364)
Supposedly the entire accessibility team got laid off [1], so there might not be anyone left to ensure that changes to existing features do not reduce accessibility nor ensure that new features are accessible. Not that I'd expect Musk to care a whole lot about concerns raised in that regard, considering that he supposedly went ahead with Twitter Blue despite significant (and well warranted) concerns from the Trust and Safety team [2]. So Twitter will probably become less and less accessible over time.

[1] https://www.wired.com/story/twitter-layoffs-accessibility/

[2] https://www.businessinsider.com/twitter-sent-musk-risks-paid...

Re:“Starting February 9, we will no longer support free acce... by dragonwriter on Thursday February 02, 2023 @01:34PM (#34631068)
> Tesla's aren't THE most accessible (by cost) EV out there, but SpaceX def is.

SpaceX is... an accessible EV? What?

Re:“Starting February 9, we will no longer support free acce... by dzhiurgis on Thursday February 02, 2023 @04:12PM (#34633118)
Most accessible satellite launcher...
Re:“Starting February 9, we will no longer support free acce... by notahacker on Friday February 03, 2023 @08:40AM (#34640892)
Ah yes, because "what's the relative cost and complexity to procure a launch for my satellite?" is famously a real example of an accessibility problem faced by people with disabilities...
Re:“Starting February 9, we will no longer support free acce... by kingofpandora on Thursday February 02, 2023 @04:43PM (#34633578)
I'm pretty sure you know exactly what the poster meant ...
Re:“Starting February 9, we will no longer support free acce... by dragonwriter on Thursday February 02, 2023 @06:12PM (#34634641)
> I'm pretty sure you know exactly what the poster meant ...

No, I don't. It obviously is trying to say something about accessibility and SpaceX, but I don't see how the sense of accessbility being discussed in the thread even applies to SpaceX, much less what claim is being made.

Re:“Starting February 9, we will no longer support free acce... by Sakos on Friday February 03, 2023 @03:07AM (#34638534)
Agree. It's quite the jump going from a user-centric website to a space launch company that is used by corporations and governments. Like, okay, I guess SpaceX is extremely accessible compared to other options in the space industry, but why would that have any bearing on how accessible the Twitter website is for you and me day-to-day?
Re:“Starting February 9, we will no longer support free acce... by dzhiurgis on Friday February 03, 2023 @03:03PM (#34646972)
Starlink has created more information accessibility that twitter will ever will
Re:“Starting February 9, we will no longer support free acce... by mynameisvlad on Friday February 03, 2023 @06:34PM (#34649401)
But that’s not in any way shape or form the “accessibility” being talked about here.

Just because it’s the same word does not mean it’s the same meaning.

Re:“Starting February 9, we will no longer support free acce... by Sakos on Saturday February 04, 2023 @02:37AM (#34652492)
I wasn't sure how to put it into words and this was exactly what I had in mind.
Re:“Starting February 9, we will no longer support free acce... by dzhiurgis on Saturday February 04, 2023 @03:42AM (#34652838)
Yes, but since we are judging a person for his merit…
Re:“Starting February 9, we will no longer support free acce... by mynameisvlad on Saturday February 04, 2023 @12:22PM (#34656144)
Do you understand where you are?

This is a comment thread discussing accessibility at Twitter, in a post about Twitter discontinuing part of its platform. It’s not a place to circlejerk Musk’s achievements, regardless how much you would want that to be so.

Explain, in exact words, what about SpaceX in any way shape or form would indicate that they know how to handle user a11y and how that would transfer over to Twitter— you know, the thing we’re actually discussing here.

Re:“Starting February 9, we will no longer support free acce... by kingofpandora on Friday February 03, 2023 @02:40PM (#34646728)
Most accessible (by cost) launch provider.
Re:“Starting February 9, we will no longer support free acce... by olliej on Thursday February 02, 2023 @03:32PM (#34632548)
Accessibility is not a by cost thing, and you aren't paying to break accessibility, you're paying to break scraping and maintaining accessibility when doing so costs money. It also requires having engineers working to keep the site accessible, but musk fired them.
Re:“Starting February 9, we will no longer support free acce... by dzhiurgis on Thursday February 02, 2023 @04:13PM (#34633133)
Scraping is much easier when sites are more accessible.
Re:“Starting February 9, we will no longer support free acce... by olliej on Thursday February 02, 2023 @06:09PM (#34634597)
Correct, which is why making something accessible and not scrapeable is harder/more expensive than breaking accessibility.
Re:“Starting February 9, we will no longer support free acce... by dmonitor on Thursday February 02, 2023 @12:07PM (#34629599)
I think it’s a terrible move to kill the stuff like postybirb that a lot of people use to make posts on multiple websites at once. they’ll have to either change their workflow to make a tweet (annoying) or just abandon twitter altogether. just makes the website worse for practically no benefit.
Re:“Starting February 9, we will no longer support free acce... by 1vuio0pswjnm7 on Friday February 03, 2023 @05:20AM (#34639426)
Does not take much effort. Below is an example using curl. For reading Twitter feeds I just get the JSON and read the "full_text" objects. I have simple custom program I wrote that turns JSON of unlimited size into something like line-delimited JSON so I can use sed, grep and awk on it but HN readers probably prefer jq. For checking out t.co URLs I use HTTP/1.1 pipelining.

Usage for reading is something like (but not identical to)

   1.sh screen_name > 1.json
   yy059 < 1.json|grep full_text > 1.txt
   less 1.txt
Usage for checking out URLs is something like (but not identical to)

   unset connection
   export Connection=keep-alive
   yy059 < 1.json|grep full_text \
   |yy030 \
   |grep "https://t.co/.{10}$" \
   |uniq \
   |yy025 \
   |nc -vv h1b 80 \
   |sed -n '/location: /s///p' \
   |ahref > 1.htm
   links -no-connect 1.htm
"ahref" is just a script turns URLs on stdin into simple HTML on stdout

Alternatively if I do not trust the URLs I might use a script called "www" instead of ahref. It takes URLs on stdin and fetches archive.org URLs wrapped in simple HTML to stdout, using the IA's cdx API.

  #!/bin/sh
  SCREEN_NAME=$1
  COUNT=500
  PUBLIC_TOKEN="Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA"
  GT=$(exec curl -A "" -s https://twitter.com/$SCREEN_NAME|sed -n '/gt=/{s/.*gt=//;s/;.*//p;}');
  echo "x-guest-token: $GT" >&2;
  REST_ID=$(exec curl -A "" -H "authorization: $PUBLIC_TOKEN" -H "content-type: application/json" -H "x-guest-token: $GT" -s "https://twitter.com/i/api/graphql/mCbpQvZAw6zu_4PvuAUVVQ/UserByScreenName?variables=%7B%22screen_name%22%3A%22$SCREEN_NAME%22%2C%22withSafetyModeUserFields%22%3Atrue%2C%22withSuperFollowsUserFields%22%3Atrue%7D"|sed 's/\(rest_id\":\"[0-9]*\)\(.*\)/\1/;s/.*\"//'); 
  echo "rest_id: $REST_ID" >&2;
  curl -A "" -H "authorization: $PUBLIC_TOKEN" -H "content-type: application/json" -H "x-guest-token: $GT" -s "https://twitter.com/i/api/graphql/3ywp9kIIW-VQOssauKmLiQ/UserTweets?variables=%7B%22userId%22%3A%22${REST_ID}%22%2C%22count%22%3A$COUNT%2C%22includePromotedContent%22%3Atrue%2C%22withQuickPromoteEligibilityTweetFields%22%3Atrue%2C%22withSuperFollowsUserFields%22%3Atrue%2C%22withDownvotePerspective%22%3Afalse%2C%22withReactionsMetadata%22%3Afalse%2C%22withReactionsPerspective%22%3Afalse%2C%22withSuperFollowsTweetFields%22%3Atrue%2C%22withVoice%22%3Atrue%2C%22withV2Timeline%22%3Atrue%7D&features=%7B%22dont_mention_me_view_api_enabled%22%3Atrue%2C%22interactive_text_enabled%22%3Atrue%2C%22responsive_web_uc_gql_enabled%22%3Afalse%2C%22vibe_tweet_context_enabled%22%3Afalse%2C%22responsive_web_edit_tweet_api_enabled%22%3Afalse%2C%22standardized_nudges_misinfo%22%3Afalse%2C%22responsive_web_enhance_cards_enabled%22%3Afalse%2C%22include_rts%22%3Atrue%7D"
There's no way I would use the Twitter website as it requires enabling Javascript and not for the user's benefit.

This solution isn't pretty but I can easily keep tabs on Twitter feeds without any need for a Twitter account, a Twitter "API key" or a so-called "modern" browser.

Re:“Starting February 9, we will no longer support free acce... by altdataseller on Friday February 03, 2023 @07:57AM (#34640455)
Can u scrape search feeds too? Ie tweets that match a certain string?
Re:“Starting February 9, we will no longer support free acce... by Hakkin on Friday February 03, 2023 @10:08AM (#34641991)
You can scrape anything you see in the UI (and sometimes stuff you cannot see). Twitter makes almost no effort to stop people from using their internal APIs, which is why them saying discontinuing the free public API is to stop malicious bots is pretty laughable. Unless they seriously increase their detection abilities for non-approved clients using their internal API, it would take any malicious actor all of a few hours to transition to using the internal API for whatever they want. Honestly, I assumed most bad actors would already be doing this, since things like spamming were already against the ToS of the public API.
Re:“Starting February 9, we will no longer support free acce... by zimpenfish on Friday February 03, 2023 @01:13PM (#34645379)
What happens if/when they block that Bearer token?
Re:“Starting February 9, we will no longer support free acce... by 1vuio0pswjnm7 on Friday February 03, 2023 @03:23PM (#34647199)
Then everyone visiting twitter.com uses the new one. The public token has been changed before. For example, in 2021, it was

AAAAAAAAAAAAAAAAAAAAACHguwAAAAAAaSlT0G31NDEyg%2BSnBN5JuyKjMCU%3Dlhg0gv0nE7KKyiJNEAojQbn8Y3wJm1xidDK7VnKGBP4ByJwHPb

Maybe something will change on Feb 9. Maybe not.

Re:“Starting February 9, we will no longer support free acce... by 1vuio0pswjnm7 on Friday February 03, 2023 @05:30PM (#34648703)
The token has been the same since at least 2020 when Twitter started using GraphQL instead of REST.

Every person visiting twitter.com is using this same token. The token is neither personal nor private.

What would be the point of changing or blocking it.

Re:“Starting February 9, we will no longer support free acce... by zimpenfish on Friday February 03, 2023 @07:14PM (#34649735)
> Every person visiting twitter.com is using this same token.

Be interesting to see if that stays the same when they're charging for the API but leaving a huge loophole with this token.

Re:“Starting February 9, we will no longer support free acce... by 1vuio0pswjnm7 on Friday February 03, 2023 @09:56PM (#34650932)
Twitter is not alone in using GraphQL this way, letting the public all use the same token or key. Other websites do it, too, as shown below.

Using GraphQL like this can be a dark pattern because to anyone using a "modern" browser that "tech" commpanies control it makes it seem like the website will not work without Javascript enabled. That's false, but nonetheless it gets people to enable Javascript because the website explicitly asks them to enable it. Then the website, i.e., "tech" company, can perform telemetry, data collection, surveillance, and other shenanigans.

Sometimes this practice might not be a deliberate dark pattern, it might just be developers who are using Javascript gratuitously. For example, HN search provided by Algolia uses GraphQL. HN puts URLs with pre-selected query terms and a public token ("API key") on the HN website. Everyone that uses those URLs uses the same key.

Unlike Twitter, HN istelf does not ask anyone to enable Javascript. The website works fine without it, including the Algolia search, as shown below.

Usage is

   1.sh query > 1.json

   #!/bin/sh

   curl -A "" -d '{"query":"$@","analyticsTags":["web"],"page":0,"hitsPerPage":30,"minWordSizefor1Typo":4,"minWordSizefor2Typos":8,"advancedSyntax":true,"ignorePlurals":false,"clickAnalytics":true,"minProximity":7,"numericFilters":[],"tagFilters":["story",[]],"typoTolerance":"min","queryType":"prefixNone","restrictSearchableAttributes":["title","comment_text","url","story_text","author"],"getRankingInfo":true}' "https://uj5wyc0l7x-3.algolianet.com/1/indexes/Item_production_sort_date/query?x-algolia-agent=Algolia%20for%20JavaScript%20(4.0.2)%3B%20Browser%20(lite)&x-algolia-api-key=8ece23f8eb07cd25d40262a1764599b1&x-algolia-application-id=UJ5WYC0L7X"
Re:“Starting February 9, we will no longer support free acce... by 1vuio0pswjnm7 on Saturday February 04, 2023 @03:28AM (#34652765)
Here is a non-curl version of HN search using custom HTTP generator yy025 and h1b, an alias for localhost address of TLS forward proxy

    #!/bin/sh

    export Connection=close;
    export Content_Type=x-www-form-urlencoded;
    export httpMethod=POST;
    x=$(echo '{"query":"'$@'","analyticsTags":["web"],"page":0,"hitsPerPage":30,"minWordSizefor1Typo":4,"minWordSizefor2Typos":8,"advancedSyntax":true,"ignorePlurals":false,"clickAnalytics":true,"minProximity":7,"numericFilters":[],"tagFilters":["story",[]],"typoTolerance":"min","queryType":"prefixNone","restrictSearchableAttributes":["title","comment_text","url","story_text","author"],"getRankingInfo":true}');
    export Content_Length=${#x};
    echo "https://uj5wyc0l7x-3.algolianet.com/1/indexes/Item_production_sort_date/query?x-algolia-agent=Algolia%20for%20JavaScript%20(4.0.2)%3B%20Browser%20(lite)&x-algolia-api-key=8ece23f8eb07cd25d40262a1764599b1&x-algolia-application-id=UJ5WYC0L7X"|(yy025;echo "$x") \
    |nc -vv h1b 80
Re:“Starting February 9, we will no longer support free acce... by pessimizer on Friday February 03, 2023 @09:35AM (#34641487)
The website is awful. It's horrific. It was the worst site I visited regularly until I started using Nitter instances. I'd rather not know what is going on than go to it. I wish they'd wind the UI back 10 years, to back when it was pleasant to browse.
Re:“Starting February 9, we will no longer support free acce... by kibwen on Friday February 03, 2023 @10:24AM (#34642238)
I look forward to someone teaching Elon Musk what version control is, resulting in him wholesale rolling back Twitter's entire stack to 2008. At last, Twitter is written in Ruby again!
Re:“Starting February 9, we will no longer support free acce... by flir on Friday February 03, 2023 @11:19AM (#34643171)
I too miss the fail whale.
Re:“Starting February 9, we will no longer support free acce... by Consultant32452 on Friday February 03, 2023 @02:02PM (#34646235)
Do you remember, I think it was 2020, when there was a big "hack" and tons of blue check accounts started posting fraud links?

Two important take-aways from that:

1) The attackers just pulled the old "Hey, I'm from IT service desk and need your password."

2) Apparently every engineer had god mode in production

I can't imagine what scary monsters are in that codebase.

Re:“Starting February 9, we will no longer support free acce... by hgsgm on Friday February 03, 2023 @11:27AM (#34643321)
The point is that the website is an API, irrelevant if it is a good or bad UI.
Re:“Starting February 9, we will no longer support free acce... by omoikane on Friday February 03, 2023 @11:59AM (#34643910)
Depending on twitter's pricing, this might not be worthwhile.

Scraping web pages is a last resort for when proper APIs are not available.