How can I display the last modified date of the post in octopress? - utc

New to all this, trying to figure out how can I add a last modified variable to my blog so that when I issue rake deploy in git all posts that changed with this commit display the current date (ideally localized). Where should I start looking ?
EDIT: just noticed that on the sitemap.xml there is this information:
<url>
<loc>http://Utumno.github.io/blog/2014/05/02/eclipz/</loc>
- <lastmod>2014-06-26T19:19:00+01:00</lastmod>
+ <lastmod>2014-07-06T17:36:37+01:00</lastmod>
</url>
So how could I use this ? - I would like to add something in some layout file so all posts display their last modified time - I find it essential for technical posts.

Related

Custom info in Jmeter dashboard

Trying to add my own table to Jmeter dashboard report. In Jmeter it's not clear enough. Tried as in https://jmeter.apache.org/usermanual/generating-dashboard.html#customs_graphs
but the custom part doesn't appear in dashboard. Would appreciate your help and examples.
It looks like the documentation you're referring is not comprehensive enough, the chapter assumes that you can plot the numeric value of a Sample Variable
So if you put the next line to user.properties file (lives in "bin" folder of your JMeter installation)
sample_variables=ts-hit
and copy and paste the example configuration from the documentation:
jmeter.reportgenerator.graph.custom_testGraph.classname=org.apache.jmeter.report.processor.graph.impl.CustomGraphConsumer
jmeter.reportgenerator.graph.custom_testGraph.title=Chunk Hit
jmeter.reportgenerator.graph.custom_testGraph.property.set_Y_Axis=Number of Hits
jmeter.reportgenerator.graph.custom_testGraph.set_X_Axis=Over Time
jmeter.reportgenerator.graph.custom_testGraph.property.set_granularity=60000
jmeter.reportgenerator.graph.custom_testGraph.property.set_Sample_Variable_Name=ts-hit
jmeter.reportgenerator.graph.custom_testGraph.property.set_Content_Message=Number of Hits :
Create some fake values for the ts-hit variable using i.e. __Random() function:
As the result you should see something like this:
With regards to custom tables - as of JMeter 5.5 it's not possible, however if you're comfortable with FreeMarker you can amend the template and add whatever you want there

How to remove post date osclass

Have problem, it's simple but not for me)
How to remove post date? I found what I need to delete in the theme file here is this piece of code
/oc-content/themes/tuffclassified/item.php
osc_item_pub_date()
i delete it. The date was deleted but not on the main page.
So how remove post date on main page?
This code need to remove in file ad-loop-premium.php for 'premium' posts
<strong><i class="fa fa-calendar fa-fw"></i><?php echo osc_format_date(osc_premium_pub_date()); ?></strong>
This for simple ads.
item.php - in file
osc_item_pub_date()

YouTube API Search v3 - Start index?

I'm using the YouTube Search API to grab 5 videos per time under a specific keyword. But I've been trying and trying, but couldent find the parameter for the start index. Does anyone know how to add it, so it gets the next 5 videos etc..?
Current URL I have:
https://www.googleapis.com/youtube/v3/search?part=snippet&q=wiz+khalifa&type=video&key=AIzaSyB9UW36sMDA9rja_J0ynSYVcNY4G25
In the results of your first query, you should get back a nextPageToken field.
When you make the request for the next page, you must send this value as the pageToken.
So you need to add pageToken=XXXXX to your query, where XXXXX is the value you received in nextPageToken.
Hope this helps

Is there a way to get last and first edit timestamp for given article in one query?

What I found is how to get last revisions for an article:
http://en.wikipedia.org/w/api.php?action=query&titles=42&prop=revisions&rvlimit=1
...and the creation date, that is first revision:
http://en.wikipedia.org/w/api.php?action=query&titles=42&prop=revisions&rvdir=newer&rvlimit=1
but is there a way to combine both requests into one query ?
It is sort of hack, and not using the API, but if you for an article appen ?action=info you will get a link to the current revision and the first revision but you will have to parse it yourself. The revision numbers are last in the URLs of the links for "Date of page creation" and "Date of latest edit" respecively. Example:
https://en.wikipedia.org/wiki/42?action=info

GetResource, dynamic parent.

my problem is the following. I'm currently making a blog-page with get-page, get-resources, form-it, and wayfinder. This question requires a decent amount of knowledge about Modx and snippits. I've got the page numberin and all working and i've got a template page with all my calls in it (called weblogTemplate). This template has the following wayfinder call in it :
[[!getResources? &parents=`5` &limit=`5` &tpl=`blogPost`]]
[[!getPage?
&elementClass=`modSnippet`
&element=`getResources`
&parents=`4`
&depth=`2`
&limit=`5`
&pageNavOuterTpl=`[[+first]][[+prev]][[+pages]][[+next]][[+last]]`
&pageVarKey=`page`
&pageFirstTpl=`<li class="controlFirst"><a[[+classes]][[+title]] href="[[+href]]">Eerste pagina</a></li>`
&pageLastTpl=`<li class="controlLast"><a[[+classes]][[+title]] href="[[+href]]">Laatste pagina</a></li>`
&pagePrevTpl=`<li class="controlPrev"><a[[+classes]][[+title]] href="[[+href]]"><<</a></li>`
&pageNextTpl=`<li class="controlNext"><a[[+classes]][[+title]] href="[[+href]]">>></a></li>`
&includeTVs=`1`
&includeContent=`1`
&tpl=`blogListPost`
]]
as you can see the parent is set here to id number 5. This is fine for the homepage but any child page connected in the blog page also uses the same template and so would also have the same menu as the parent. You could use a fix to simply create 1 template for a page and keep using a different getResource call but keep in mind that it is a blog im making, new pages keep getting added. The user can't (, and wouldn't even understand to) make a template and edit any code. A solution i thought of would be to make the parent id dynamic, so it adjust to whatever page it is currently on. So for example if it was on the page with id number 12 it would make the parent call set to 12 and so show all the content under id number 12. If anyone has any ideas / thoughts / solutions i would be very grateful to hear them.
(a link about wayfinder that i used.)
The best solution would be to use two templates - one for main and one for the blog pages and use in blog templates:
&parents=`[[*id]]`
The problem with the user solveds by setting default_template in the system settings.
This worked for me:
[[!getPage?
&elementClass=`modSnippet`
&element=`getResources`
&parents=`[[*id]]`
&depth=`0`
&limit=`10`
&pageNavOuterTpl=`[[+first]][[+prev]][[+pages]][[+next]][[+last]]`
&pageVarKey=`page`
&pageFirstTpl=`<li class="controlFirst"><a[[+classes]][[+title]] href="[[+href]]">Eerste pagina</a></li>`
&pageLastTpl=`<li class="controlLast"><a[[+classes]][[+title]] href="[[+href]]">Laatste pagina</a></li>`
&pagePrevTpl=`<li class="controlPrev"><a[[+classes]][[+title]] href="[[+href]]"><<</a></li>`
&pageNextTpl=`<li class="controlNext"><a[[+classes]][[+title]] href="[[+href]]">>></a></li>`
&includeTVs=`1`
&includeContent=`1`
&tpl=`blogListPost`
]]
Thanks to Vasis for the provided help.