Should I be using clean URLs or URL parameter in my Web App? - url

Which URL structure should I use for my Web-app?
Clean URLs like this
http://dashboard.company.com/sales/john-doe/2017/32
or with URL parameters?
http://dashboard.company.com/sales?person=john.doe&year=2017&week=32
Are there any guidelines for this?
Edit to explain my question better From the user perspective, the two ways are identical in ways of sharing the url. For the programming part they are not, I use Flask. I want know if there's a standard way of handling it, what is the better way?
Background
I am developing a Sales Dashboard for internal use at my company. It display the sales of every sales person. I want to make the reports shareable so that my colleagues can send their own page for a certain weeknumber with each other, or whatever. Or the boss can easily get the page for a meeting with the sales person.
No SEO
Just to stress this point. I don't need clean URLs for SEO.

It doesn't matter at all, by adding the parameters as GET or POST they will be visible but if you use a framework for your app, you should use clean as possible because the parameters to the controllers must be specific and not by data. Otherwise if is not a big project you can use like that but you need to make sure that soon you wont have something like lang?en or something which will be as main parameter. It's up to you, read GET x POST differences and you'll figure it out better.

Related

Rails - Dynamic vs static application for an e-learning platform

I am about to start developing an e-learning platform where users will be able to watch educational videos for school curriculums and take quizes and so on. The part im not sure about is how exactly should i go about creating each course on the website. Should I create it as a static page where all the content is added manually through code for each course and each video, or should i make it as a CMS whereby each video for each course is uploaded through an upload form and then displayed (using paperclip for example)? Can someone explain to me which is the best approach and why? Baring in mind that video uploading will not be on the user's part, only I will be uploading and adding content to the website.
You should go the CMS way, because it will make your life easier. By generating a lot of static pages, you will see that there are things you want to reuse at another point and then you have to code them another time. With a CMS you can predefine objects like a survey or video content, so that the admin or course leader can use these things in a more efficient way. Mostly, admins aren't techies, so they would be thankful for such a CMS.
This is also important for the following development. Let me give you an example:
You created hundrets of surveys, but then somebody discovers a bug. You need to change your code in too much places. While generating only one model of a survey means also only one fix.

SignalR dynamic endpoints

I'm working on a collaborative document editing application where clients can open up a document, post edits via a webservice, and subscribe to updates made to the document using SignalR. I'm experimenting with my SignalR setup and can't quite get what I want.
My gut tells me that I should shoot for a setup where each document has an endpoint with a name like "subscribe", so the full path would be "/documents/1/subscribe" for document 1 and "/documents/2/subscribe" for document 2. However, as far as I can tell, SignalR wants me to have a single endpoint, and then manage which clients get updates either by using Groups or by managing the list of subscribers for a document in code myself and send out individual messages.
As a result I have two questions.
Is there a way to do what I want to do what I want to do with SignalR?
Is there a reason what I want to do is totally wrong headed and silly?
Aside from "dedicated", friendly looking URLs I don't really see any value to this vs. just using groups. In fact, the only thing I could see it doing is adding more overhead because of the way the message bus internals of SignalR work with respect to scale.
If you did want to try this, the base thing you'd need to figure out would be registering routes on the fly per document, which, as Phil Haack's RouteMagic has done for MVC, I suppose it might be possible for SignalR route configurations as well.

Receive notification when site server adds page

I've been doing some programming off and on for my brother, who is a stock trader. I'm wondering if it is possible to receive a push notification when a site server adds a page. For example, the site smallcapfortunes.com frequently adds pages that are simple extensions off the main URL. For example, the site regularly adds pages under URLs such as /neca/, /stev/, etc.
Are there existing methods to execute this? Or is this something I need to write myself? Has anyone here written anything like that?
I know there are existing sites to track basic updates to a single page. In my research, though, I haven't found anything like this.
Please let me know if there are any other details I need to provide.
Generally you can only get a push notification if a specific website offers that service.
Some websites publish a structured (XML) site map. If the one you're interested in does that, you could pull that sitemap on a regular basis and look for differences.
you're most likely going to want to use http://scrapy.org/ to go through the site and find new /neca/ and /stev/ urls, etc, then just trigger the script every so often.

Track pageviews in Google Analytics on partial url of Grails application

For my Grails application I want to set up Google Analytics to track only "partial" url's. I 'll explain:
a typical Grails url consists of the following parts: domain + application-name + controller + action + id
e.g. www.mydomain.com/myapp/controller/action/12345
As far as I understand for Google Analytics the page to be tracked is identified by the entire url. For my purpose I'm not interested in the id part of the url: I want to know which actions have been performed, but I need not know for which id the action was executed.
And of course I would like a generic solution, because I have multiple controllers and multiple actions... Maybe some kind of filter stating "I want to track pages 3 levels deep (/myapp/controller/action)" would do? Or a filter stating "exclude everything from url after the last /"?
Any help would be much appreciated.
Kind regards,
Pieter
I think this issue is best solved within the realm of Google Analytics, where you can create a specific report that ignores the id-part of the url.
That way you can just use Google Analytics at its easiest and need not make any code changes to your project
There can be several approaches. First thing comes to my mind is taking one of these steps:
Using profile filters (more info)
Generating the same virtual pageviews on each action id (more info)
Using advanced segments tool with a proper condition (page url pattern match) (more info)
Each approach has its pros and cons, choosing proper one depends on the goal you are trying to achieve.
I think this question is best answered by this article.
As the other contributors suggested, I too thought the issue should be resolved in Google Analytics. I clicked around a bit and got hopelessly confused.
Solving the issue within Grails is much much easier. In short the answer is:
in the Google Analytics tracking javascript there is a
"_trackpageview" action
this action can take as parameter the url you want to track
in Grails I can simply add the stuff I want to track:
application/controller/action
my Google Analytics script is in my main template
I just use: _gaq.push(['_trackPageview','myapp/${controllerName}/${actionName}']);
("myapp" should be the name of your application)
(${controllerName} and ${actionName} are generically available
variables in the Grails views)
Hope this will help others.
Thnx for the other answers.

Search product websites without api

Sorry for the bad title and description, but I was wondering if there is anyway I could search/list products from other sites (say Express, American Eagle), from a web app I create, even if the site doesn't have an API.
Thanks
Sure. How do you think Google and every other search engine does it? They just spider the sites and index the contents. The devil, of course, is in the details. But it's certainly possible to do.
I don't think so. Unless you want only to fetch some data from a certain HTML page, then you need to use some regular expressions. But searching the database is not possible if you don't have the ability to connect to it directly or via some APIs.

Resources