11 ms·
Require-from-Twitter
- rcthompson 11y agoMake sure you scroll down and read the mandatory disclaimer before commenting on the merits of this approach.
- deleted 11y ago[deleted]
- cphoover 11y agofunny :)
- michael_storm 11y agoThis is the Internet of Things for code. This is wonderful. This is also probably a snarky shot at npm [1], for those who lack context. [1] https://news.ycombinator.com/item?id=11340510 https://news.ycombinator.com/item?id=11340510
- Rauchg 11y agoMy goal was for it to be entertaining and educational[1]. I love npm (which made this possible to begin with!) [1] ES6 features (arg defaults, destructuring, modules, template literals, String.prototype.repeat), babel configuration and runtime compilation, async / await
- tstrimple 11y agoI feel like require-from-twitter really helps enforce the Unix philosophy. It's hard to write modules with multiple responsibilities in 140 characters.
- kristianp 11y agoI wonder how large a system could be created using nested tweets of js. Needs versioning though.
- taneq 11y agoAs large as you want: https://users.soe.ucsc.edu/~jpagnutt/Elevator_Pitch.pdf https://users.soe.ucsc.edu/~jpagnutt/Elevator_Pitch.pdf (PDF warning)
- ntumlin 11y agoThis does need a warning, but PDF isn't the reason.
- yxlx 11y agoWhat does the link do?
- 55555 11y agoIt opens your mind until your brain falls out.
- PhasmaFelis 11y agoIt's just a PDF. It's a funny PDF, though.
- bobwaycott 11y agoWhat. The. Hell. Amazing.
- plugnburn 11y agoActually, there are several immutable FS-over-tinyURL projects. I have created some of them too. A real problem with Twitter is that you can get banned quickly for doing this.
- vidarh 11y agoCareful what you wish for - someone is bound to try to prove you wrong now.
- anotherevan 11y agoThere will be a fork that allows concatenation of multiple tweets.
- gregorkas 11y agoThis is brilliant :).
- javajosh 11y agoHey, nice one! But reading the code I didn't see any arg defaults or destructuring. Saw the other stuff though! Which is pretty darn cool.
- Rauchg 11y agoI was considering the source tweet as well :D
- jsprogrammer 11y agoExcept the problem isn't editing, but deletions. Twitter allows deletions and explicitly requires you to process and honor deletion events in their TOS. They have even blocked API access to programs that don't honor deletions. So, just as bad (or, maybe worse, in that you can't even keep around committed code that comes through this process, if the originating tweet was deleted) as npm.
- ghayes 11y agoOn the other hand, no one can reclaim a tweet after it's been yanked. So, `require from tweet` is a safer system for your production systems.
- jsprogrammer 11y agoTwitter API clients are required to delete all copies of tweet contents when a tweet is yanked, or Twitter will revoke API access, which might bring your production systems to a deserved halt.
- jamstruth 11y agoYes but they won't accidentally pull a malicious version of the tweet pretending to be the original. They'll just stop working
- jsprogrammer 11y agoThat is an unacceptable outcome for production systems.
- Navarr 11y agoReading the NPM blog today - that's not really a problem in NPM. Reclaiming a module name requires a breaking version for any new code, so it shouldn't be an issue there.
- bronson 11y ago
- tomtomtom777 11y agoI would say it is an equally snarky shot at all those who choose to depend on a third party module for something that can be written in 140 chars.
- 0x7fffffff 11y agoWell there you go. Problem solved.
- cphoover 11y agothis would actually be an interesting coding challenge and experiment to see if something could be built worthwhile in modules limited to no larger than 140 characters.
- HappyTypist 11y agoNot a good constraint. Just make each tweet module export a string, and concatenate them and eval().
- m_mueller 11y agowell, that could be easily solved by prohibiting eval?
- nostrademons 11y agoConcatenate them and then run them through Babel...
- jschmitz28 11y agoAre the tweet modules allowed to requireFromTwitter other tweet modules?
- franciscop 11y agoit has been done, http://140byt.es/ http://140byt.es/
- aioprisan 11y agoPretty comical. I bet folks would actually use this to some extent, without realizing that Tweets can also be deleted.
- manojlds 11y agoBut the point is they cannot be edited or replaced.
- BinaryIdiot 11y agoNeither can npm module versions without direct assistance from the company (which, if you were able to gain favor, you might be able to get Twitter to do the same). The only difference is someone can't take over a tweet should the original tweet author delete their account.
- Buge 11y agoTo solve that problem we need require from bitcoin blockchain transaction.
- melvinmt 11y ago> without realizing that Tweets can also be deleted. Yep, just like NPM modules.
- softawre 11y ago> also
- spotman 11y agothe next version should have a require from #hashtag, so that it can be fault tolerant, and would last longer when lawyers request a takedown!
- cmpolis 11y agoTangentially related(tweet sized js) and an awesome project: https://t.d3fc.io/ https://t.d3fc.io/ is a collection of d3 visualizations from tweets. The code is cryptic on first inspection, but if you look at the sandbox setup, it starts to make sense and 140 chars is a wonderful constraint. eg: https://t.d3fc.io/status/694991319052103680 https://t.d3fc.io/status/694991319052103680
- spriggan3 11y ago> "dependencies": { > "babel-preset-stage-0": "6.5.0", > "babel-preset-es2015": "6.6.0", > "babel-runtime": "6.6.1", > "babel-plugin-transform-runtime": "6.6.0", > "babel-cli": "6.6.5", > "babel-core": "6.7.4", > "twit": "2.2.3", > "entities": "1.1.1" > }, The problem right here. Just to run a script you now need to import a whole third party language runtime ? what other language does pull this kind of stunt ? Javascript is madness.
- BinaryIdiot 11y agoMost of that is so people can use the slightly nicer syntax of the newer version of JavaScript in a more supported way as it's transpired. Honestly I'm not a fan because, as you can see, it's a big ass bucket of extra complexity for some extra, albeit nice, syntax updates. I'm waiting for wide support of ECMAScript 6 before I start using it widely. Though I feel I'm a bit in the minority here I just don't want to deal with all of the transpiling complexities if I don't need to.
- abecedarius 11y agoI've started using ES6 sans 'transpiler' for web development on Chrome. There's still the build step for release to other browsers, but so far I haven't bothered. (I think your decision is completely reasonable; only pointing out that since just this month, with Chrome 49 out, you can develop without any build step.)
- david-given 11y agoYup. I'm working on a Polymer project in ES6. I develop in Chrome with it pointing directly at my source, so I get a full debugger and quick reloads by hitting the F5 button. Then I use crisper/babel/vulcanise via a ninja build script to generate an ES5 deployment package for the other browsers. It works really well. (ES6 is so, so much nicer than ES5. It's almost like a real language now!)
- 11y ago
- deleted 11y ago[deleted]
- dbpokorny 11y agoIf you can get a good toolkit for writing a GLR parser, then people will write their own tokenizers, BNF formal grammars, and plug it into your parser. It would take a single person about two to six weeks to get something thoroughly polished in JavaScript along the lines of what is described. However I think that without some form of centralization, (perhaps a subreddit? idk) it will be difficult for the standardization and namespace organization process to take place. If it is just one person, there is no question of standardization; if it is multiple people, the question of who is in charge of the namespace becomes relevant. Who is in charge of the namespace in this particular experiment?
- chris_wot 11y agonpm over twitter? A site populated by trolls and spammers. What could possibly go wrong?
- logn 11y agoA developer gets upset at unilateral actions by NPM resulting in a project being renamed or taken down unnecessarily (potentially breaking builds). So this dev decides to take down all their projects, as a sort of protest. This breaks a lot of builds. The JavaScript community thinks a clever solution is utilizing Twitter as part of the build process? Because then everything would be dependent on Twitter not adding an "edit tweet" button...
- hisham_hm 11y agoIt was a joke.
- orangegrain 11y agoLol they are so far ahead of you. It's a jab at the situation.
- pandler 11y ago> The JavaScript community thinks a clever solution is utilizing Twitter as part of the build process? The JavaScript community thinks a hilarious, tongue-in-cheek solution is utilizing Twitter as part of the build process. FTFY
- logn 11y agoOops. I retract my comment and denounce myself.
- mbrock 11y ago...and then someone on Hacker News implies that the playing around of a single individual represents what "the JavaScript community thinks"...
- melvinmt 11y agoWhy is this not a npm module yet? Name suggestion: kik2
- deleted 11y ago[deleted]
- capitalsigma 11y agoNot enough Twitter, can't you tell that's the problem here
- franciscop 11y agoFor everyone who doesn't know it, there's a project called http://140byt.es/ http://140byt.es/ compiling many code snippets that fit in a tweet (; There was also a clever trick to compress/uncompress ascii text by using base[huge number] or something like that (full unicode) so it could be uploaded to twitter, but I don't remember the exact number
- Retr0spectrum 11y agohttps://github.com/ferno/base65536 https://github.com/ferno/base65536
- chirau 11y agoWhat does the code in the parent post do?
- franciscop 11y agoAwesome! thanks, also here's the reasoning from the Why? [1] > I wanted people to be able to share HATETRIS replays via Twitter. > Twitter supports tweets of up to 140 characters. "Tweet length is measured by the number of codepoints in the NFC normalized version of the text." [1] https://github.com/ferno/base65536#why https://github.com/ferno/base65536#why
- t1amat 11y agoStandardized modules like this are exactly what the node.js-stack bot herding community has needed! On the plus side: if you saw this dependency in a module you were looking at you would know to think twice.
- t1amat 11y agoStandardized modules like this are exactly what the node.js-stack bot herders need! On the plus side: if you saw this dependency in a module you were looking at you would know to think twice.
- wallzz 11y agocan someone explain what is this ? I really have no idea
- joeblau 11y agoThis person wrote a tweet and the tweet has code[1]. This snippet in JavaScript allows you to import that code into your code as a module. I think this is trolling on state of the Node community because over the previous few days, people have found some pretty interesting dependency architecture[2]. [1] - https://twitter.com/rauchg/status/712799807073419264 https://twitter.com/rauchg/status/712799807073419264 [2] - http://www.theregister.co.uk/2016/03/23/npm_left_pad_chaos/?mt=1458720804410 http://www.theregister.co.uk/2016/03/23/npm_left_pad_chaos/?...
- progx 11y agoLol YMMD
- m_mueller 11y ago> // ES6 leftPad and he even had space for a comment in there....
- anotherevan 11y agoThere's still another eight days until April first.
- deleted 11y ago[deleted]
- nivertech 11y agotwitter doesn't have an edit button, but it does have the delete button ;)
- eric_h 11y agomartin-adams solved this problem: https://news.ycombinator.com/item?id=11352113 https://news.ycombinator.com/item?id=11352113
- yAnonymous 11y agoI'm currently talking to investors to start a business around this. Please don't delete it.
- sdegutis 11y agoI can't tell if your comment is satire thanks to Poe's law.
- bronson 11y agoI can't even tell if the article is satire. (I'm guessing it is, but this actually seems useful. Poe is tough.)
- kowdermeister 11y agoAnd I also can't tell if you and the one you replied to is serious, because it's pretty obvious that twitter-requre it's a clever joke :)
- joshmanders 11y ago> it's pretty obvious that twitter-requre it's a clever joke Joke... So I shouldn't have replaced production with this?
- cdnsteve 11y agoMaybe this will make Twitter finally profitable?
- giancarlostoro 11y agoTwitter is known for deleting twitter accounts when they get reports of tweets though.
- fallenshell 11y agoShots fired.
- peterkelly 11y agoWhat we really need is require-from-stackoverflow
- martin-adams 11y agoMaybe to make this more reliable, you should retweet the module first, then require your clone.
- thoughtpalette 11y agoThanks for providing some morning entertainment. Love this comment.
- jjawssd 11y agoBest comment in the whole thread.
- javajosh 11y agoIf you make a good change, make sure to tweet it back with #PR.
- rburhum 11y agoHi. I don't know how to program (otherwise I would do this myself), but can you port this to Google+ please? My office blocks twitter. Thanks!
- andremendes 11y agoWell, twitter staff was saying they'd last at least another ten years, would NPM?
- philmander 11y agoRequire from stack overflow? require('how do I prepend spaces to a string')
- JBiserkov 11y agoAutocomplete from stack overflow: https://news.ycombinator.com/item?id=11335766 https://news.ycombinator.com/item?id=11335766
- ikeboy 11y agoFor deleted tweets: On every fetch, submit the tweet to archive.org and archive.is if not already there. If tweet is deleted, fetch from there instead.
- homero 11y agoShouldn't have voted against increasing character count, we could've had a free cdn
- olegp 11y agoAlong similar lines, I made it possible to use NPM packages in the browser without a build step or server: https://github.com/olegp/bpm https://github.com/olegp/bpm More info here: https://meetabit.com/talks/37 https://meetabit.com/talks/37
- amelius 11y agoFilesystem interface to Twitter: http://softwaretechnique.jp/DownLoad/twfs_en.html http://softwaretechnique.jp/DownLoad/twfs_en.html This is probably more generic than the project discussed here.
- bagnus 11y agoI'm impressed no one has posted their own version for a different language.
- howeyc 11y agoI know this is supposed to be funny, BUT if you vendored and kept a local copy in you're build environment, you wouldn't have to worry if the tweet gets deleted. This is the lesson I see noone talking about. Of course, using a tweet as a source for a library is silly.
- jjawssd 11y agoNext up: require from bitcoin blockchain
- plugnburn 11y agoWhy not just use anonymous gists in conjunction with RawGit CDN? Unique IDs, no way to change or delete (since the gists are anonymous), served right out-of-the-box with a proper content type from cdn.rawgit.com.
- mooreds 11y agoTwitter finally has a business model! Who knew that source code hosting would be the killer app?
- escoundel 11y agoTDD - Twitter Driven Development
- sorenjan 11y agoThere's also a package manager for it: http://require-from-twitter.github.io/ http://require-from-twitter.github.io/ > require-from-twitter is the core code for the tweet package manager. Our beta version has only one dependency: npm. But we're working hard on adding more dependencies as quick as possible.
- ChikkaChiChi 11y agoGithub could easily solve this problem: If a repo meets certain criteria in licensing, create the ability to "Static Publish" a release. This feature communicates that the version repo is the public's and cannot be removed by the individual or team. Github also enters the agreement that if there is ever a need to "move" the version due to copyright infringement, it provides either aliasing or sooner sort of notification and time bomb before it goes offline. If this were done, folks could be in the know about which packages and dependencies are at risk, so they enter into the install with their eyes wide open.
- amptorn 11y agoOne of the interesting side-effects here is that while it encourages you to write very small packages, it also strictly caps the maximum number of packages which you can add as dependencies of your own package. There's only so many `require` calls you can fit in a Tweet.
- fallenshell 11y agoLet's host systemd on Twitter.