How to fetch articles on custom page in MODX CMS - modx

I am new to the MODX CMS so I don't know more about this CMS. I tried to fetch articles in the custom template please see screenshot 01:-
Screenshot 01
This is the shortcode of articles which I am using to fetch the articles on the custom pages please see screenshot 02:-
Screenshot 02
This is the article template and this is working fine with the shortcode Please see the Screenshot 03:-
Screenshot 03
I Researched on the google so I found this
[[getResources]]
but I don't know how to use it.

First of all check this reference: https://docs.modx.com/current/en/extras/getresources/index
But as for me it'll be much better to use pdoResources(has useful option &showLog for your needs) from pdoTools extra:
https://docs.modx.pro/en/components/pdotools/snippets/pdoresources
For test purposes please call uncached (with ! sign before name) snippets f.e
[[!getResources]], [[!pdoResources]]
Also be aware these snippets don't show hidden and unpublished resources by default, you should point this directly: f.e.
[[pdoResources?&showUnpublished=`1`]]
[[getResources?&showUnpublished=`1`&showHidden=`1`]]

Related

Instagram API - get own posts for website

I read through all the dev docs stuff at https://developers.facebook.com, but I found no simple solution to solve that one simple question. I want to display my own posts detail at my website. Is that even possible?
This is possible using IG Basic Display API and the GET /{user-id}/media endpoint
You will need to build a Login flow which is described in the Get Started guide
https://developers.facebook.com/docs/instagram-basic-display-api/getting-started
https://developers.facebook.com/docs/instagram-basic-display-api/reference/user/media

Error message from dialogflow while configuring knowledge base from URL

While creating knowledge base in dialog flow from URL, I am getting message "Error". However I am able to see FAQ which are on this URL when opening in browser. For reference please find below screenshot below, If feasible suggest how can I find exact reason for this error as dialog flow don't give any other relevant error for this.
URL which I am configuring knowledge base is :
https://www.owens.edu/faq/early-alert/
enter image description here
The full error message is the following:
"Failed to crawl https://www.owens.edu/faq/early-alert. Please verify that your URL is publicly accessible and is hosted on a site that can be indexed by Google Search."
I have tested the FAQ page you shared and by using the "Developer tools" of Chrome, I was able to see that error message. I suggest you to take a look at the "Supported content" documentation for knowledge bases in Dialogflow. In there, you can see the following statement:
Files from public URLs must have been crawled by the Google search indexer, so that they exist in the search index. You can check this with the Google Search Console. Note that the indexer does not keep your content fresh. You must explicitly update your knowledge document when the source content changes.
Therefore, make sure to meet all the requirements listed there.

Is it allowed to use this link (https://www.instagram.com/[username]/?__a=1)

at the moment I am working on a Instagram implementation for the homepage of my school.
My problem was, that I didn’t got access to the account, so I couldn’t generate an access token (which all free joomla plugins need).
So I have decided to write my own plugin (I am not the best programmer, but it works), because of that I found this link (https://www.instagram.com/[username]/?__a=1) where I could get the JSON of the public page without the need of any token or ID.
My question is if I am allowed to use it or not (because I can’t find this link in the official api)?
We've built a small API that scrapes exactly that data and presents it to you via JSON:
https://apinsta.herokuapp.com/u/<username>
(In case you are still interested in this)
This URL closed by instagram on 14 April. You can get user's information json with this link:
https://i.instagram.com/api/v1/users/USER_ID/info/
Also you can find user ID like this:
Go to the https://www.instagram.com/USERNAME/
Look source code and find this code:
"id":"
You'll see the user ID between quotes.
Good luck.

Nodejs URL modifications for SEO purposes

I have a working App built on Nodejs + Drywall + Openshift, sorry it's in Arabic. Basically, I am looking to improve on the service, but having a major roadblock. The site is a classifieds site and I need to optimize it for SEO, however, my links to ads are shown like this...
http://yobyobi.com/ads/show/55c9ff9dcf68970612ba2d38
55c9ff9dcf68970612ba2d38 is the Ad ID on my mongoDB, I do also have a record for the indicating the date and the title of Add combined "Sun-Nov-22-2015-8-pm-2007-camry-for-sale", the goal is to make the URL pretty and understandable by search engines. The end result I want to accomplish is one of the following:
yobyobi.com/ads/show/55c9ff9dcf68970612ba2d38/Sun-Nov-22-2015-8-pm-2007-camry-for-sale
yobyobi.com/ads/show/Sun-Nov-22-2015-8-pm-2007-camry-for-sale/55c9ff9dcf68970612ba2d38
yobyobi.com/ads/show/Sun-Nov-22-2015-8-pm-2007-camry-for-sale/
Now, option number 3 would be ideal, but would slow down my application if I have to search by Ad title instead of Ad ID. Similar to what Stackoverflow is doing (attached pic)
Stackoverflow example
Code
app.get('/ads/show/:id', require('./views/account/ads/index').read);
The above line returns the Ad for me with all the details including the title that I want to use, but the problem is that I cannot change the route URL after I receive the title.
I am not sure if this module would help in whatever I am trying to do it's called "named-routes"
Has anyone ran across this problem? If so can you share some insight on how to best tackle the problem?
Thanks in advance,
well, the solution was dead simple, do the following:
add * as a wild card like this
app.get('/ads/show/:id/*', require('./views/account/ads/index').read);
now when you create the links to the post, attach anything where the * is and it should show the same Ad without breaking the page.
Cheers

Is it possible to get the Instagram news feed through the API?

When you open the Instagram APP you can look at your news feed where you can see that someone is now following you, likes or has commented on a certain photo.
When I look at the Instagram API (http://instagram.com/developer/) I can retrieve likes and comments when I request a certain media ID. However in order to know if someone has commented on a photo of mine I would need to scan all the photo's and request it's comments to check if any new comments have been made.
Does anyone know of a better way? Help is appreciated.
If it helps, content for "Following" tab is available at http://instagram.com/api/v1/news/, and "News" tab at http://instagram.com/api/v1/news/inbox/ (you need to be logged in to your account).
All URLs point to internal instagram:// protocol so you would need to replace them when parsing and there seem to be no pagination options.

Resources