Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
YO MAMA HEAD
Sep 11, 2007

oiseaux morts 1994 posted:

So, I've had a toy idea for a Twitter account that I want to generate tweets and send them out on a (non-annoyingly) consistent basis, but I'm wrestling with the best way to do a high-level implementation.

I have a server sitting around I want to put to use, and my thought is to write something in PHP that will generate the tweet string, then make a POST request to the Twitter API. Presumably I'll need the PHP OAuth extension to integrate the account I need (as per v1.1 of the API) as well.

However, if I do it in PHP, I'll either have to make the request manually or set up a cron job. The other alternative is to write a Python script that would maintain an uptime and make the same RESTful requests as above.

Does this sound reasonable, or am I way off here?


My first PHP project was a cron'd bot that made OAuth tweets, but something broke a few weeks ago... it worked fine while it lasted, though. http://twitter.com/dogsmcgee

Adbot
ADBOT LOVES YOU

YO MAMA HEAD
Sep 11, 2007

It also uses lozenges for more subtle inline links, which is sort of strange but immediately obvious.

YO MAMA HEAD
Sep 11, 2007

Lumpy posted:

It can be tough to tell. Every few months we get a serious "nobody should support browsers older than 6 months; if they can't upgrade gently caress them!" post. I thought maybe it was that time again.

It must be!

YO MAMA HEAD
Sep 11, 2007

Not sure if this is completely portable (certainly not browserwise), but I just set up the following as a BBEdit Clipping to insert line number for debugging JS in Chrome:

code:
console.debug('LINE: ' + (new Error).stack.split('\n')[1].split(':').reverse()[1]);

YO MAMA HEAD
Sep 11, 2007

socialsecurity posted:

So I've been out of the web design game for a while but my msp want's me to start working on some light sites. I used to work in Joomla a bunch it seems that it is not as popular as it was like 5 years ago, I've been reading good things about Drupal should I head in that direction or there an easier/better CMS out there.

Has anyone else used Craft CMS? I used it on a few small projects that benefited from its blank-slate-ness and liked the idea of being able to define all of my own custom fields, but had some issues with its (reported?) memory usage on my hosting.

YO MAMA HEAD
Sep 11, 2007

One of my projects at work involves uploading audio and then being able to annotate segments on a website. The main site is done in CodeIgniter, which is a decision I will be happy to revisit when I'm not the only developer on the job.

I've written a very slick web app that records audio, transcodes to Vorbis, stores it in IndexedDB, and eventually uploads to the main site using FormData. Initially, auth between the two was done in hacky way where the recorder just started its own CodeIgniter session on the main site and used the same URL endpoints as a normal user, but I've been working on implementing a proper RESTish API with OAuth2 for this and other potential add-ons. The recorder still mostly works in the client but now has a tiny Lumen backend to handle the password grant OAuth flow, CSRF, and some basic encryption.

It's working pretty well and is a big improvement over the old system, but I'm stuck when it comes to the file upload. Since requests now move through Lumen rather than directly to the main site, how do I think about my upload destination? Some good and bad possibilities:
  • Reimplement the access token (+ refresh token?) flow on the client and make requests directly to the main CI site (sounds like a bad idea and misses the point of the client secret on the server).
  • Upload to the Lumen server and then upload that file to the main site.
  • Upload to the Lumen server and instruct the main site to download the file.
  • Use the Lumen server to make an authenticated request to the main CodeIgniter site and receive a temporary upload endpoint, possibly linked to the access token. Return that path to the client and upload the FormData as with the original client-only app.

Obviously something like the last one is what I'm hoping will work; avoiding data on the Lumen server is an added bonus w/r/t HIPAA. Any thoughts?

YO MAMA HEAD
Sep 11, 2007

In the interest of implementing as much OAuth as possible without fully understanding why, I'm using a short-lived access token that's exposed to the client and a refresh token that's encrypted by the Lumen server and kept in an HTTPOnly cookie. Currently my API requests pass from the client through Lumen to the API so that the refresh flow can automatically happen in middleware, but I'm not sure how much sense that makes now that I think about it—I end up making two routes for each API resource, one of which (Lumen) doesn't do anything but hit the actual API server . Should the client use its access token to directly hit the API and only call out to Lumen if it needs a fresh access token? If that's the case, uploading directly to the API would be more obvious.

YO MAMA HEAD fucked around with this message at 18:03 on Dec 16, 2015

YO MAMA HEAD
Sep 11, 2007

My wife decided to leave her marketing job last week (for a number of reasons—our 5-month-old, bad commute, limited advancement opportunities). She's looking at sharpening some of her creative skills (Adobe) and learning some new ones to re-enter the workforce in 2017. What's the best way for absolute beginners to learn web design in 2016? I work full-stack (although without a heavy design component w/r/t aesthetics) but am self-taught and don't even know what order to introduce things. I imagine, though, that a video course on fundamental HTML/CSS/JS to start, then a scratch guide to git(hub), then moving quickly to preprocessors/front-end frameworks? Really torn between basics and state-of-the-art/best practices stuff—making my boy scout troop's site on an FTP connection in Notepad was a good introduction for me in middle school but seems completely counterproductive now.

YO MAMA HEAD
Sep 11, 2007

Good point! I definitely suffer from having a very narrow point of view into the industry—which is why I know I'm such a poor match for figuring out what she should do. I should apologize to her for casting her as a less knowledgable version of me instead of someone who doesn't have background in development.

So the fields you mentioned are already areas she's studied and worked on in print/digital design (with the exception of UX). In terms of web basics, is a site like Codecademy something worth going through while she's catching back up on more general design topics?

YO MAMA HEAD
Sep 11, 2007

:) definitely biased but I wasn't trying to brush away design necessarily. I meant there are a couple of stages that seem useful for her—general design topics like brushing off her Robert Bringhurst and other books from school; getting back up to speed with Adobe, which could lead in directions that could completely exclude web stuff; gaining some basic familiarity with how web design works (not necessarily a ton of coding but just what HTML/JS/CSS do); "actual web design", which it seems I have a poor misunderstanding of. I've been reading whatever looked interesting on sidebar.io for a year or two now but never really gained an appreciation for different roles, workflows, and so on—my (3-person, mostly prototypic/academic) shop is still stuck with Adobe and fully realized HTML/CSS/JS as our only two points on the road of design. Thanks for detailing some of what you do!

YO MAMA HEAD
Sep 11, 2007

HardDiskD posted:

Is this just "stick a bunch of files on the server" like people were doing at the very start of the web?

Went to a Jekyll session at connect-tech last week and the presenter mentioned https://staticsitegenerators.net/. There are literally hundreds of these

YO MAMA HEAD
Sep 11, 2007

Have you looked at Laravel Echo? I've never used it (beyond seeing it commented out in the Laravel js boilerplate) but it looks like it could work for you.

YO MAMA HEAD
Sep 11, 2007

There's a distinction between .classA.classB (which looks for elements with both classA and classB), .classA .classB (which looks for elements with classB inside of elements with classA), and .classA, .classB (which looks for elements with either classA or classB).

YO MAMA HEAD
Sep 11, 2007

kedo posted:

Here's a problem I thought I'd never have again... I'm having issues with color profiles in Firefox. Apparently Firefox uses a calibrated monitor colorspace instead of sRGB.

FWIW, I encountered this sometime last year and decided it was pretty much unsolvable/unavoidable (browsers may have changed). I ended up combining SASS, CSS variables, and SVG so that I could define everything with hex in the browser. I ended up managing more of it by hand rather than having a really tight build process but it made the colors right.

YO MAMA HEAD
Sep 11, 2007

That's why you convert everything to Q units for consistent quarter-millimeter measurements.

Adbot
ADBOT LOVES YOU

YO MAMA HEAD
Sep 11, 2007

Do you mean that the element's ID is 20 lines long? Why?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply