How can I get the SObject from a url? Sample url:
In Lightning, the standard approach is to use the force:hasRecordId, as outlined in this article. Basically, if you use this, your component will automatically have an attribute called recordId that you can use in your controller:
var recordId = component.get("v.recordId");
Even better, implementing this interface allows you to "hint" places where the component can be used in the Lightning App Builder.