Shopify: Variables Available on Thank You Page? - rest

I've got a small bit of code on my Shopify thank you page for a home grown fulfillment system. In oversimplified terms, it outputs a URL with template code that uses the {{id}} field.
<p>
Your order information is {{id}}! This is not the actual code,
this is just an oversimplified version for this question
</p>
Up until a few weeks ago, the {{id}} template variable would output the ID of the order object. I use this ID and the Shopify REST api to fetch order information. Now, for reasons that remain unclear to me, this outputs a different number that appears to be the checkout-id field.
Is this intended behavior? Is there anyway to get the old, real order object ID back? I can think of numerous ways to work around this, but I'd rather not mess with a system that's worked in a stable way for the past 5 years.

Documentation on this is spotty at best, but it seems like the old global liquid variables I've been using have changed their behavior. Acording to Shopify's documentation, on that Thank You page
You have access to the checkout and shop liquid objects
There's documentation on both the checkout and shop objects, and I was able to get the old behavior I was after by replacing {{id}} with {{checkout.order_id}}.
It also appears there's a liquid order object available as well, but given it's not documented as being available on the checkout page, I'm not sure I'd trust it to keep working.

Related

Determining how many people have been added to a facebook group by a single member

I am the admin of a Facebook group and am trying to keep track of how many people each user has added. I cannot seem to nail down how I can easily write a script to:
Determine how many people a User has added.
Echo that to a file in the format $User:$number_of_added_members.
I've been made aware I cannot do this with the API, I am banging my head against a wall here. If anyone could at least point me in the right direction it would be much appreciated.
I just did this...
actually i am a programmer and did it in the hard way because i needed group by users. I hoped that the graph api at least give me an xml of user with added by in order to make my code read it but it did not so what i did is just to copy the table on the members page and paste it on a txt file and make a python code read it and make a dictionary of user: number_of_users_he_added.
it was quick but there is a problem that the members page does not give u all the results, its infinity scroll and i have a lot of members.
u can write a js script that read the dom instead of copy paste or even a chrome extension but still have the problem with the infinity scroll.
if facebook provide the added by field in their graph it will be great
Maybe you can work with the site which lists all members and look for the string below the member which says "added by on " But I'm not sure, how long this stays before it switches to "in the group since"
Edit
Use a crawler software like the one in Symfony to traverse the HTML of the page. You will need a PHP CLI for this tool. DOMCrawler from Symfony

How do you keep track of your comments on GitHub issues?

I want to find all the GitHub issues that I commented on. I tried searching for commenter:mbigras type:issue like the Searching issues and pull requests GitHub article suggests. But that method returns fewer results than the public activity section of my profile.
See both attached images:
Search method
Doesn't display current results:
Profile method
Gets mixed up with other public activity:
Is there a way to get the full history of my comments on GitHub?
EDIT
author:mbigras type:issue gives wider results but still not the full history:
What I'm looking for is a way to quickly view all my comment/issue history in all issues.
EDIT
I emailed GitHub about this. Search doesn't match the public activity section because search indexes issues by creation date and not last active date.
How do you keep organized about which issues you've commented on?
Search for commenter:username in the main Github search box.
For example commenter:gavinandresen
To see recent activity, select Recently updated from Sort dropdown
You can also narrow the search: is:issue commenter:gavinandresen
I have also been very frustrated when I could not find an issue that I have commented on a while ago. I even did not remember the project it was in. I knew only the problem I was referring to.
Then, I went to the Notification settings on Github and saw there is an Include your own updates option that is unchecked by default.
Once you check it, Github will send you an e-mail notification about every comment or PR you make. They you probably want to add an appropriate label and filter for emails so Github messages do not clutter an inbox.
My life has changed since then. Now, every time I want to find something I have written on Github, I just search for it in the e-mail notifications.
You can view all the issues on Github you have commented on by going to https://github.com/notifications/subscriptions and selecting Reason as Comment.
This will show all the issues that you've commented on.
You can also filter the issues by selecting other reason such as Assign, Author, Manual, Mention, etc. but you can select only one reason at a time. Also, you can filter the issues by repository by selecting the concerned repository from dropdown after clicking Repository
Search All GitHub using the search term is:issue author:#me
You can also check the following links.
For all your subscriptions
https://github.com/notifications/subscriptions
For all your issues
https://github.com/issues
For all your pull requests
https://github.com/pulls
In case someone is interested to know how to find these links, go to github's resi api documentation. The URL's are not explicitly described there. However, look for the page names bellow REFERENCE.
If you lowercase the relevant word (for example Issues become issues, Pulls become pulls) and put that after https://github.com/, you most probably will find what you are looking for.
This might be a little late, but there's also another way to find what issues/PRs you have participated in. This method also brings in a lot more things you might be interested in too!
When you are on the website main page, on github.com, use the keyboard shortcuts as described here to open your pull requests or issues. The shortcut for these is in particular [g, i] for issues and [g, p] for pull requests (I remember g by go, but whatever works for you.)
After you go to the page directed by these shortcuts you are greeted by an entire screen of goodies you can use! The search bar can be edited and the buttons can be used to make your experience fast!
Type involves:<your username> in the search box on the GitHub's main page. This will find all the issues that you commented on, was assigned to or mentioned in.
For example, if your username on GitHub is unclebob, the search query should look like:
involves:unclebob
Or if you're logged in to GitHub, then simply:
involves:#me
Note the difference between involves and similar search qualifiers - author and commenter:
author will find only the issues that were started by you; if you comment on the issue that was started by someone else, author query won't return it in the search results.
E.g., compare involves:unclebob and author:unclebob type:issue.
commenter will find only those issues where you commented second or later (creator of the first comment in an issue is considered its author and not a commenter); if you start an issue and then never comment on it, the commenter query won't return it in the search results.
E.g., compare involves:unclebob and commenter:unclebob.
In other words, when it comes to searching comments, author and commenter return only a subset of involves' results. So I recommend using involves not to miss anything.
Also, since Github is on the web, any HTTP search engine works, eg Google, Bing, etc. This works to the extent of your search engine's quality and the uniqueness of the writer name.
(Indeed, I actually do this all the time when I need to find any previously written web (engine)-accessible publication, including those on StackExchange. Names I use are 1 in probably an infinity, so Google often works better than forum search options.)
(Sample Google link.)
If you want to search for multiple users in a single search, use it like in the global search bar without the OR logical conjugation:
commenter:FantomX1 commenter:FantomX1-github
since the similar google way approach with 'OR' would not work
commenter:FantomX1 OR commenter:FantomX1-github

Joomla 1.5 REST interface?

I want to query some information about articles or users from a Joomla website for my client-side application.
SOP can be ignored. I am working with Joomla 1.5.26 and I have an account with full rights. Unfortunately, I cannot access the source code at the moment.
For example:
http://example.com/index.php?option=com_content&Itemid=53
I would like something like this, but this returns full html page, not the article information.
And what if I would like to get many items at once sorted by some attribute like:
http://example.com/index.php?option=com_content&count=10&sortBy=latest&format=xml
Would like to see something like:
<articles>
<article>...<article>
<article>...<article>
<article>...<article>
</articles>
I haven't found a good explanation of the default query schemes.
Worst case scenario would be parsing the html, but I really hope there is some other way.
Any ideas?
Important: Joomla 1.5 and 2.5 are not longer maintained. Please upgrade to a stable and safe release.
But if you really insist, you can use "tmpl=component" as paremeter or just the index2.php to get the component content only (without template).
Everything else you will find under https://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core

List of possible 'changes' values in Facebook Realtime Update

I've implemented this for my site:
https://developers.facebook.com/docs/graph-api/real-time-updates/v2.0
and I am receiving updates successfully. The format of these updates is fairly easy to understand by understanding the JSON response. However, I can't find a list of possible types of changes (possible values for the JSON response) so I can handle / replicate all the scenarios that may come up.
Is this published anywhere?
The possible values for 'item' and 'verb' are not documented. Here's everything I have observed when receiving updates for pages only:
Items:
like
share
comment
photo
video
post
Verbs:
add
remove
edited
hide
unhide
Can't claim this is comprehensive, but that's the best of my knowledge based on reviewing logs of many thousands of updates. I would guess that user, permissions, and payments RTUS have their own sets of possible values.
Not sure what you mean with types of changes exactly. There's
https://developers.facebook.com/docs/graph-api/real-time-updates/v2.0#subscribefields
https://developers.facebook.com/docs/graph-api/real-time-updates/v2.0#receiveupdates
If you click on the first links down arrows on the right side, you'll get the list of fields that can change for the user and the page objects.
After some searching, I came across https://developers.facebook.com/docs/public_feed#updates There's a reference to http://activitystrea.ms/ in the code:
<activity:verb>http://activitystrea.ms/schema/1.0/post/</activity:verb>
Unfortunately, the website doesn't work apparantly, but one can view an old version here:
https://web.archive.org/web/20140720095121/http://activitystrea.ms/registry/verbs/
This seems to contain the list of possible verbs wihtin this schema. Which of those Facebook actually uses is not clear to me unfortunately. There's the specs as well: http://activitystrea.ms/specs/json/schema/activity-schema.html#verbs

Google Rich Snippets warnings for hCard

I get the following errors from the Google Rich Snippet Tool for my website http://iancrowther.co.uk/
hcard
Warning: This information will not appear as a rich snippet in search results results, because it seems to describe an organization. Google does not currently display organization information in rich snippets
Warning: At least one field must be set for Hcard.
Warning: Missing required field "name (fn)".
Im experimenting with vcard and Schema.org and am wondering if I'm missing something or the validator is playing up. I have added vcard and Schema.org markup to the body which may be causing confusion. Also, I am making the assumption I can use both methods to markup my code.
Update:
I guess with the body tag, I'm just trying to let Google discover the elements which make up the schema object within the page. I'm not sure if this is a good / bad way to approach things? However it lets my markup be free of specific blocks of markup. I guess this is open to discussion but I like the idea of having a natural flow to the content that's decorated in the background. Do you think there is any negative impact? I'm undecided.
I am in favour of the Person structure, this was a good call as this is more representative of the current site content. I am a freelance developer and as such use this page as my Organisation landing page, so I guess I have to make a stronger decision of the sites goals and tailor the content accordingly, ie Organisation or Person.
I understand that there is no immediate rich snippet gains, but im a web guy so have a keen interest in these kind of things.
With schema testing, I find it easiest to start from the most obvious problem, and try to work our way deeper from there. Note, I have zero experience with hcard, but I don't believe the error you mentioned actually has anything to do with your hcard properties.
The most obvious problem I see, is that your body tag has an itemtype of schema.org\Organization. When you set an itemtype on a dom element, you are saying that everything inside of that element is going to help describe that itemtype. Since you've placed this on your body element, you are quite literally telling Google that your entire page is about an organization.
From the content of your page, I would recommend changing that itemtype to schema.org\Person. This would seem to be a more accurate description. Once you make that change and run the scanner again, you may see more errors relating to the schema and we can work through those too (for example, you'll probably need to set familname and givenName).
With all of that said, you should know that currently there are no rich snippets that you will gain from adding this schema data. Properly setting this up on your page, is only good to do, especially since we don't know what rich snippets Google or others will expose in the future, but currently you won't see any additional rich snippets in Google search results from adding these tags. I don't want to discourage you from setting this up properly but I just want to set your expectations.