adding tracking parameter is treating url as differnt - comments

I am using Disqus for comments management.But the problem is its treating below link as different
http://gpuzzles.com/mind-teasers/logical-age-riddle/
http://gpuzzles.com/mind-teasers/logical-age-riddle/?source=tracking1
as a result comments in one post is not reflecting in other post.
Please suggest a solution

By default Disqus will identify a unique thread by its unique URL in the window. This is a very easy way to integrate, but isn't too reliable as you're seeing.
To prevent this you would want to pass a 'disqus_identifier' and/or a 'disqus_url' javascript variable. You can read about these here: http://help.disqus.com/customer/portal/articles/472098
That'll override looking at the window location for a unique identifier.

Related

Get Github Issue based only on title

I need to modify the body of an existing GitHub issue in a Project. All I'll be passed is the title of the issue, and a word (the word exists in the body, and I'll just need to fill the checkbox next it).
It looks like to do this I'll need to use the GET API to get the body of the issue, modify it, and then use the EDIT API to swap in the new body. However the GET API can only be called with the issue number. I need to do all this as quickly as possible. Is there some way to search via an API call?
Thoughts much appreciated!
Edit: All my issues are in the same project (and issue titles will be unique there). I've also recently discovered Github's GraphQL API, which may be applicable here.
You can use the issue search endpoint with the in and repo¹ keywords:
GET /search/issues?q=text+to+search+in:title+repo:some/repo
Of course, issue titles aren't guaranteed to be unique. You'll have to request each of the issues that comes back and see if its body contains the word you're looking for. Even in that case you could get multiple positive results.
It would be much better if you could search by issue number.
¹I've assumed that you really mean "repository" when you say "project". But if you're actually talking about GitHub Project Boards you can use the project keyword as well or instead.

Retrieve quote from other website in same installation

I'm attempting what I thought would be simple but has turned complicated. Basically, I have two websites in one installation. I need to retrieve the current quote (guest or logged-in) from the opposite website.
The sessions are shared across both. Here's what I've tried so far:
Setting the current store to the opposite store briefly, grabbing cart and setting it back. This actually does work for wishlists but not quotes
Setting the opposite store in core/session and retrieving quote
Parsing core/session visitor data for ID I could use to do SQL query. There is a visitor_id but have not found the link between that and quote
Has anyone done this before? Seems like there should be a way to grab quote using sessionId with storeId but I haven't found it.
Thanks!
Argh, was looking in the wrong session namespace. Should have been checkout/session (obviously) instead of core/session. Will go ahead and answer it, in case someone else has same obstacle.
$ecommerce = Mage::getModel('core/store')->load('ecommerce_store_view');
$quoteId = Mage::getSingleton('checkout/session')->getData('quote_id_' . $ecommerce->getWebsiteId());

How do I take each line of a text file and insert them into a web form? Specifically, for testing domain name availability

I wrote a Ruby script that appended "data" to the beginning of every word of the English dictionary, and then filtered out various strings using different parameters, and now I want to use a site like namecheap or gandi.net in order to take each of these strings and insert them into the domain name availability checker in order to determine which ones are available.
It is my understanding that this will involve making a POST HTTP request of some kind, as well as grabbing the element in question, but I don't really understand the dynamics of what to read about in order to do this kind of thing.
I imagine that after a few requests I will be limited, but as a learning exercise I am still curious as to how I would go about doing this.
I inspected the element (on namecheap) to see what the tag looked like, to find any uniquely identifiable class/id names that I could use to grab that specific part of the source, and found that inside a fieldset tag, there was a line of HTML that I can't seem to paste here, so here is a picture:
Thanks in advance for any guidance in helping me learn about web scripting!

How do I have my plugin fire before another in docpad so I can preprocess the content?

I would like to create a plugin which preprocesses content like markdown before it is passed to marked.
I don't want to create yet another extension to tack on the filename but would rather just search for a pattern in the content and if found do a substitution before marked has a chance to render.
I tried using the render event but my plugin seems to fire after marked even though its name sorts below it. What order do the plugins get used in?
I also tried using a renderBefore event but I can't figure out how to manipulate the content from there.
Any help would be appreciated.
Thanks in advance!
Jeff
Adding a plugin.priority will affect the order in which plugins are called with greater priorities being executed first.
The default plugin priority is 500.

Is freemarker safe when allow user edit their template

I'm new with freemarker, I need know about this problem too choose it or not, I will strip XSS by myself but I don't know are other features of freemarker safe when site allow user edit their template?
Oh, goodness no! This is basically equivalent to allowing the user to evaluate arbitrary code. Removing XSS after the fact only removes one potential vulnerability. They'll still be able to do plenty of other things like manipulate POST parameters or perform page redirects.
John is right. And letting the user actually edit freemarker templates themselves seems odd. If you are outputting user input again (like displaying the search term on the results page) I'd suggest using the using the ?html string built-in, it'll save you from the most rudimentary xss attacks (e.g. "you searched for '${term?html}'").
So as others said, it's not safe. However, if those users are employees at your company or something like that (i.e., if they are easily accountable for malevolent actions) then it's not entirely out of question. For more details see: http://freemarker.org/docs/app_faq.html#faq_template_uploading_security

Resources