How to display a post's original timestamp on my blog? - html

Firstly, this is my first time asking a question on stackoverflow, sorry if it's not precise enough or if I'm not doing it correctly!
My blog posts' already have the timestamps of when I either posted them or when I reblogged them. But I also want that when you click on a reblogged post's details, you can see the exact date a post has been created (NOT when I reblogged it).
For example, in the following screenshots you can see a post I reblogged by user "lmaonade", the timestamp at the top shows when I reblogged the post. In the second screenshot, you can see the post's info, with the same timestamp repeated. I would want that second timestamp to instead display when the original blogger posted it.
1. A reblogged post by user lmaonade reading "i work at the post office beating the shit out of our fragile package". The timestamp reads "(13 Fév 23 # 12:38PM)"
2. The previous' post info reading "Posted on 13th février 2023 at 12:38pm"
Note: "Fév" and "février" mean february, it's just that my browser is in french.
Tumblr's variable "{DayOfMonth}", "{Month}", "{Year}", etc. display the date of when I reblogged a post, and I can't find any other variable that would show when it was originally posted.
You can see a list of Tumblr's variables here.
They have variables like "{ReblogRootName}" that show the username of the blog a post was created by, but nothing like "{RootMonth}" (I tried other things like "{MonthRoot}" or "{ReblogRootMonth}", but I don't think anything else exists other than the official list), so I don't know how to go about displaying something like that.
I suppose it'd need to be dependent on the original post's ID, and not the reblogged post's ID, but I don't know at all how to do that, or if there's even a way.
I'd be glad if anyone had an idea how that could work, or another idea entirely :]

Related

Redirect to page depending on user input

On the website (http://bread.org.nz/teams) users pick the team they want to donate to (using paypal). How can I redirect to a webpage, depending on who they donate to, so I can give options like "share on facebook that I voted for team 'x' "?
thanks
I see you're using item_number but I think that's being deprecated. Now, you can include custom variable in your donation link and when it posts back to you (callback), that custom variable will be included in the data.
Your donation LINK may look something like this
...&item_name=RALLY+TEAM+DONATION&custom=I+PICK+TEAM+1&currency_code=NZD
If this doesn't work, then I think you should achieve it with a custom made solution which of course isn't much reliable.
So, your donation links on the buttons may look like this example.com/donate.php?team1. From there, you can get information of Team 1, set a PHP session say $_SESSION['team_chosen'] = 'team1'.
Now, on the callback page, you can check team in the session and decide further.

mediawiki - make link evaluation case insensitive

i'm running a small wiki and our users would like an interface they find less confusing. the complaint is that a page titled something like 'Big_news' displays as a redlink if the link is 'Big News' or 'big news' or some other upper/lower case permutation, and they'd like these to appear as normal-coloured links if the page exists. when a user clicks on the link, the appropriate page is displayed correctly, but it would be better to see that the page already exists beforehand.
i've tried to implement solutions such as those presented here, here, and here, but they don't work -- links still display as redlinks on the page. [indeed, i think some of the articles are out of date ; mediawiki 1.27 doesn't seem to have the tables mentioned in them.]
any ideas how i might go about doing this ?
You could look at how $wgCapitalLinks is being used. Chances are, all-lowercase titles will need special casing in the same places where code needs to be branched based on that setting.
You could hook on HtmlPageLinkRendererBegin and use the link target to run a database query to find any case-insensitive matches for the page name (on page title, and it'd have to do this only for internal links), and then replace the target if there's a match.
thanks for the tip, #Sam Wilson. that looks like an interesting function, but unless i miss my guess, i'd have to query the database for every single link in a page -- correct ? if so, i think performance would suffer. anyway, that hook didn't seem to work for me [mostly because my unfamiliarity with mediawiki left me scratching my head...]. the solution i came up with is as follows :
1- add the variable $wgLinksIgnoreCase to your LocalSettings.php file. set this to true if you want link displays to be mapped case-insensitively.
2- modify the file includes/parser/LinkHolderArray.php as follows [diff accurate for wikimedia version 1.29] -
283a284
> global $wgLinksIgnoreCase;
370a373,376
> if (!empty($wgLinksIgnoreCase)) {
> $mapper = array_combine(array_keys($colours), array_keys($colours));
> $mapper = array_change_key_case($mapper);
> }
373a380,381
> if (!empty($wgLinksIgnoreCase) && isset($mapper[strtolower($pdbk)]))
> $pdbk = $mapper[strtolower($pdbk)];
as i say, i'm not very familiar with the software, so if anyone who is familiar with it finds a more elegant solution, feel free to chime in.

How to expand a json for a specified website, based on the url

This might be a bit of a confounded question, but please bear with me:
If I were on a site, wanting to read comments through the json, as with this particular site, how would I expand this particular site such that I can see more than 10 comments? Currently, the ending to the url looks like /?content_id=60902841-c238-364c-92f0-68e8b4dce996&_device=full&count=10&sortBy=highestRated&isNext=true&offset=10&pageNumber=1&_media.modules.content_comments.switches._enable_view_others=1&_media.modules.content_comments.switches._enable_mutecommenter=1&enable_collapsed_comment=1.
I tried changing the pageNumber to a higher number and got the same results. I tried change the &count=10 to &count=50, which also doesn't work.
Thanks!
Each website will be a case by case. Some websites will allow you to expand it at the end of their url, as in:
https://somesite.com/search&page=1&resultcount=100
where you would change the parameter of resultcount to a higher value. Some sites cap the value at arbitrary values, and some don't have this parameter.

og:title doesn't correpond with the one I set

I have a question regarding the meta property in php.
I have set
and I have a list of products that need to be displayed on the first page. Whwn I click the first product and click the like button the title that appears is different from the one I set, but when I click the other products and then click like I get the correct title. I tried clearing the cache but it didn't work and I tried verifying the link using http://developers.facebook.com/tools/debug and here it teels me that the title is the one I set.
Can anyone tell me what am I doing wrong or what might be the problem? Or maybe you have a soultion for this. :D
Thanks!
Without seeing the page which is being changed and liked, it's hard to know if I am answering your question, but the information may be useful to you anyway.
The issue may be with how many likes have already added up for the page.
Note that og:title and og:type are only editable initially - after
your page receives 50 likes the title becomes fixed
Source: https://developers.facebook.com/docs/opengraphprotocol/
This has happened to me before. The easy fix/workaround I found was this: I had been appending a query string to the page URL for tracking some stats. That URL with the query string had over 50 likes. Once I changed the query string, or left it off, the page had a different amount of likes. So when I used the Facebook linter/debugger, I used the new URL and it picked up my og:title and description change.
Are you able to post a link to the page you are having this issue with?

How to count retweets

I am trying to create a flash retweet button, and i want to know how to count the retweets for a specific status. Can anybody help me?
Thanks in advance,
Alex
Have a look at the Twitter API documentation on retweets.
Here's an example:
http://api.twitter.com/1/statuses/retweets/16208928355.json
Just finish with id.format.
I just thought I should add (from the Twitter API Retweet documentation):
statuses/retweets
Returns up to 100 of the first retweets of a given tweet.
So it looks like there is a limit of 100. There is also rate-limiting on this part of the Twitter API:
API rate limited (about rate limiting):
1 call per request
http://apiwiki.twitter.com/Rate-limiting
Sorry to provide a problem and not a solution. To get around this you might be able to use Tweetmeme with the Tweetmeme API:
http://www.webmaster-source.com/2009/11/23/count-your-retweets-with-the-tweetmeme-api/
This would only work if you had some sort of URL in the Tweet (e.g. a shortened bit.ly URL). Sorry I have misunderstood this.
As an aside, I am looking at using this approach to allow website users to Tweet a particular bit of content from a page (similar to using the page meta-tags with Facebook Open Graph 'Like' buttons):
http://ejohn.org/blog/retweet/
So I guess what I'm advocating for is tracking the shortened link as a method for tracking retweets, and also as a means of tracking 'tweets' from a landing page. Has anyone done anything similar to this?