Is there a way to construct a URL that will lead directly to the comment left by someone on a blog article?
For exammple, is there a way to construct a URL that will lead directly to the comment left by Alexander in the following blog article?
http://zeroseconde.blogspot.com/2008/09/fin-du-papier.html
Similarly, is there a way to construct a URL that will lead directly to the comment left by jokeefe on the following blog article?
https://www.metafilter.com/74067/The-Image-Mill
You mean like this? -> http://zeroseconde.blogspot.com/2008/09/fin-du-papier.html?showComment=1223573700000#c4070187594579786156
If so, simply right click on the comment date and copy the url.
The same works to get the URL for jokeefe's comment in the second question.
Related
I have a reddit post link here:
https://www.reddit.com/r/dankmemes/comments/6m5k0o/teehee/
I wish to access the data of this post throught the redditkit API.
http://www.rubydoc.info/gems/redditkit/
I have tried countless times and the docs don't make too much sense to me. Can someone help show how to do this through the ruby console? Or even an implementation of this in rails would be really helpful!
Looking at the #comment method on the gem, it takes a comment_full_name and performs a GET to api/info.json with that parameter as an id (seen by viewing the source for that method). If we look at the reddit api for api/info the id parameter is a full name for the object with a link to what a full name is.
Following that link, a full name for a comment is
Fullnames start with the type prefix for the object's type, followed by the thing's unique ID in base 36.
and
type prefixes
t1_ Comment
So now we know the comment_full_name should be t1_#{comment's unique id} which appears to be 6m5k0o. Here, I'm unsure if that's already base36 or if they want you to convert that into base36 before passing it. Without seeing what all you've tried, I would say
client = RedditKit::Client.new 'username', 'password'
client.comment("t1_6m5k0o")
and if that doesn't work
client.comment("t1_#{'6m5k0o' base36 encoded}")
For questions like this, it would be nice to see some of your code and what you tried/results they gave. For all I know, you've already tried this and have a reason it didn't work for you.
I would test this out for you, but I don't have a reddit account for the gem to sign in with, this is just my guess glancing at the documentation.
I have built a simple website and have the requirement to display all post from a blog for a year.
For example www.mysite.com/blogs/2015 should display all posts of 2015.
However, this year is not the real creation date of the post but it is given as input while creating the post (I have added new field to the editor).
I should also have a way to access a post with a unique URL like www.mysite.com/blogs/2015/2, which should display the second post of 2015.
The post number is unique for the year. So I cannot use the content id.
I was able to make this work with my own controller, but an issue remains:
When posts are listed it will attach the URL created by the AutoroutePart, which will be like www.mysite.com/blogs/first-post.
I attempted to change this URL while creating the post by updating the Path property of the AutoroutePart but had no luck.
Any suggestions or advise are appreciated.
You can define you own route for any content item which has the AutoroutePart.
Example in you situation you need to edit the content definition of the blog posts. So under the Content Definition menu you select Blog Post, then edit, then you click on the expando arrow next to the Autoroute label and you'll see the Patterns field where you can define your own pattern.
Basically we're trying to change all of the book now or book online reservations on our website. For example, on our whale watching page, the new reservation link needs to look like this:
https://reservations.whales.com/res(L10!group=a)?
Here's where I'm entering the URL in the back end of my website: http://oi62.tinypic.com/j61ysg.jpg
The problem is when I enter the URL with the question mark at the end in our CMS, and I click save, it strips out the ? at the end, which messes up the query I'm trying to get it to do. Is there a way I could - just as an example - enclose the ? in some other characters so that the ? isn't at the end? (Maybe my CMS only has a problem with it being at the end?) I'm open to any suggestions.
I was able to fix this by adding a / to the end of the URL.
I'm working on a new advert website and want to implement some good SEO URLs.
I got category URLs like:
/category
/category/sub-category
This seems ok. What about detail pages?
Option 1:
/announcements-and-notices/announcements-various/15880/suscipit-dis-molestie-malesuada-vestibulum-ut.html
Option 2:
/adverts/15880/suscipit-dis-molestie-malesuada-vestibulum-ut.html
In reality my website has a pretty long URLs due to multiple areas you can shop. So it would become:
/en/area-name/announcements-and-notices/announcements-various/15880/suscipit-dis-molestie-malesuada-vestibulum-ut.html
/en/area-name/adverts/15880/suscipit-dis-molestie-malesuada-vestibulum-ut.html
Which detail page would be a better URL? The first option seems to be better if the product has no long/good title. The second seems better as its the most relevant one and shortest especially with long category names.
I would like to hear your thoughts!
EDIT:
I found this two google docs:
http://www.google.nl/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CDYQFjAA&url=http%3A%2F%2Fwww.google.com%2Fwebmasters%2Fdocs%2Fsearch-engine-optimization-starter-guide.pdf&ei=lXyaT6T_L8zR4QSM4c2qDw&usg=AFQjCNEMj8KHxhxQz9cMLoMxMDiLdrAbJw
http://support.google.com/webmasters/bin/answer.py?hl=en&answer=76329
I think I will be going for /adverts. Anyone disagree?
i have seen many of SEO analysts miss something about optimizing their webpage and that is your page will be optimized for only some keywords not all keywords. it is not important how length is your URL. you should first analyze whether the contents in your webpage is rich enough to have such URL with these keywords or not. if the answer for every keyword is yes then the more length will give you the more rank.
I think you can even set your pages up in a way to use only the slug and skip the id, such as:
/adverts/suscipit-dis-molestie-malesuada-vestibulum-ut
or even just:
/suscipit-dis-molestie-malesuada-vestibulum-ut
like this and refer straight to the adverts controller and the advert itself, which has this slug assigned to it (the one with id 15880).
This way you'll have nice and clean URLs. Just assign and keep an unique slug for each advert and handle it using .htaccess, or dynamically inside the code of your site, if the system allows it.
Cheers.
Spoiler alert: this is NOW a question, so apologies to anyone that read it purely as a discursive topic :)
Anyway, I was doing a little research today re adding routes via javascript when i thought that a bit of google research wouldn't hurt. Basically, my aim was to do away with the following type of construct within my views:
and replace it with something akin to:
well, i lucked out a little today after finding this fantastic article (which isn't mine nor do i have any affiliation other than respect for the piece of work):
http://weblogs.asp.net/zowens/archive/2010/12/20/asp-net-mvc-javascript-routing.aspx
this really has been a missing link (or so i thought) for me when dealing with routes via javascript. However, the 2nd code example is misleading and actually won't produce what the example leads on. Can anyone suggest a fix for this and/or an alternative solution to allow this fluent convention of js routes within mvc views??
cheers...
[edit] - question edited 22:16 GMT to explore deeper options on this topic, plus changed title (removed OT portion).
So the question is why the second code example won't work as expected. Here's the answer, post currently doesn't return anything. This is an example of a certain developer not looking at the details of the code. When you use homePageUrl, the value will be undefined.
To actually get the home page URL, you'd do the following:
$.routeManager.action({controller:'Home', action:'Index'}).toUrl()
So, the moral of the story is that the code is a bit broken. The post action SHOULD return an object where you can put "toUrl()" right after the post is performed, like this:
$.routeManager.action({controller:'Home', action:'Index'})
.post(function(data){ alert(data); })
.toUrl();
I'll be fixing this bug in a bit!