Sharethis api top shared urls - api

I'm working on building a block on my site that contains the top 5 most shared urls on my domain via the sharethis api, I've been testing it and have gotten some unexpected results...
when I check the domain statistics api, I get the expected results:
request:
http://rest.sharethis.com/analytics/V2/getDomainStats.php?domain={my-domain}&pub_key={my-publisher-key}&access_key={my-secret-key}
response:
{"status":"SUCCESS","from_date":"20120620","to_date":"20120627","data":
{"domain_summary":[{"clicks":1092,"shares":134,"traffic":1393,"date":"06\/20","channel_stats":
[{"shares":86,"clicks":404,"traffic":412,"channel":"facebook"},
{"shares":25,"clicks":617,"traffic":898,"channel":"email"},
{"shares":12,"clicks":0,"traffic":0,"channel":"fblike"},
{"shares":7,"clicks":42,"traffic":31,"channel":"twitter"},
{"shares":3,"clicks":0,"traffic":0,"channel":"plusone"},
{"shares":1,"clicks":0,"traffic":0,"channel":"pinterest"},
{"shares":0,"clicks":17,"traffic":19,"channel":"blogger"},
{"shares":0,"clicks":12,"traffic":33,"channel":"google_bmarks"}]}.....
I've truncated those results obviously since they go back for a week...
when I try to find out what urls are the most active from my domain:
request:
http://rest.sharethis.com/analytics/V2/getTopUrlStats.php?domain={my-domain}&from_date=2012-06-27&to_date=2012-01-01&pub_key={my-publisher-key}&access_key={my-secret-key}
response:
{"status":"SUCCESS","from_date":"20120627","to_date":"20120101","last_batch_date":"20120626","data":{"top_urls_summary":[]},"today":""}
Obviously this is not what I'm looking for, I have the clicks and on the sharethis site I can go to my metrics and view the info I'm looking for with no problem, but the api is not answering with any data. I have tried changing the date range or omitting it completely (which for some reason returns an empty data set) to no avail. Has anyone else run into a similar problem?

Ok Sharethis support finally got back to me about the problem:
According to sharethis api :
To Date End date for data. Note: date must be in yyyy-mm-dd format. Default is 7 days ago.
From Date Start date for data. Note: date must be in yyyy-mm-dd format. Default is 'today'.
These are backwards, that's 1 reason why my call wasn't working, "To date" should be the more recent date when defining the date range... the "defaults" don't work so you must enter both values, and when you enter todays date as the "To Date" it may return "collection failed", so best to start with yesterday

Related

Date_start and date _stop default api fb

I have the following url where I am using campaigns, I want to request the information per day but even if I put "date preset" or "time range" I always get date_start and stop as seen in the image, my question is: it possible to remove date_star and date_stop or why does it default? and if it can be removed, how can you request the information per day?
My url :
https://graph.facebook.com/v6.0/act_id/campaigns?&fields=id,status,objective,insights{account_name,campaign_name,adset_name,impressions,reach,clicks,frequency,unique_clicks,cost_per_inline_post_engagement}&limit=100&date_preset{today}&access_token=" "
What i get is:
date obtained when making the request

SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect date value: '05/20/2020'

I'm making an app with laravel, this features a calendar. I'm using "fullcalendar" which is very restricting on date format and AFAIK only accepts 'yyyy/mm/dd'. I'm using the jQuery datepicker and have edited the formatting to make it work. That all works fine and on the insert for a long time I would never get this error, however suddenly it's started giving me this error after days of not having it. I really don't understand. Unless there's a way to change fullcalendar formatting to match the accepted formatting for SQL, which has not affected my app since now, then I'd love to hear it.
(error: QLSTATE[22007]: Invalid datetime format: 1292 Incorrect date value: '05/14/2020' for column)
Thanks.
fixed it, my formatter was broken

VSTO accessing date of message as entered in the header

in VSTO I want to access the date of a sent message as it appears in the recipient clients header. Sent Items return an empty transport header (for obvious reasons) however I can't find a date to match the date that a non exchange recipient system would get from the message header.
I've tried:
CreationTime();
PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x30070040").ToString(); //MAPI creation time
.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x30080040").ToString(); //MAPI last modification time
.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x0E060040").ToString(); //MAPI Date Message Delivered
But none of them match the actual Date: that appears in the header on the recipient end. Taking into account timezones, etc. the Date field is a couple of seconds off.
Any ideas on how to access the date of a sent item as it appears to the clients? I would have expected date of delivery or date of creation to match.
Try PR_CLIENT_SUBMIT_TIME (DASL name http://schemas.microsoft.com/mapi/proptag/0x00390040). Also keep in mind that OOM always rounds the date/time properties to the nearest second.

Eventfinder API: start_date parameter doesn't work

I am trying to get results from the Eventfinder API. It's a REST based service.
I want to get events from tomorrow.
But instead I will always get events from today (probably because default time is now).
Let's assume we have Friday the 2014-03-28 and I want events of Saturday the 2014-03-29.
When I request this url:
http://api.eventfinder.co.nz/v2/events.xml?rows=1&start_date=2014-03-29 I am getting events of the 2014-03-28.
For me it's not clear how to set the time, after I read the documentation on Eventfinder.co.nz
Now I have found a solution by myself.
It's important setting the end_date parameter too. If the end_date is not set, the event must happen at the current date AND a the date where the start_date is set.
This is an example usage, getting events of Saturday the 2014-03-29.
http://api.eventfinder.co.nz/v2/events.xml?rows=1&start_date=2014-03-29&end_date=2014-03-30

Selecting a datetime range in YII input form

Here is the problem.
I have to create a submission form on my Yii-based website. The form requires to enter a datetime range.For that I am using "jui datetimepicker" third-party Yii extension.
http://www.yiiframework.com/extension/datetimepicker/
I use two date fields with this extension pertaining to start and end time respectively. So, what I want to achieve is be able to restrict the start datetime only to time in the future (neither past dates nor time should be selected) and the end time itself should be restricted to the maximum of three hours following the start time.
EXAMPLE: a user wants to schedule an event. They choose a date and time, which are of course in the future. Let's say they choose March 15, 13 O'clock as the start time in the start time field. Once they are done and move to the next field ("end time"), the respective datetimepicker restricts the range of time from March 15, 13:00 to March 15, 16:00.
Hence the second datetimepicker should be dynamically updated depending on the input of the first one.
It's possible o specify date range in the datetimepicker starting from the current date, but there is nothing like that for the time selection, so a user still can select time which has already passed.
It's not that I want to solve this problem with this extention, if anybody has any suggestions about YII solutions allowing to specify a datetime range in the most clean and effective way - it would be much appreciated.
You should use the edaterangepicker extension instead.
Given the API for the jquery timepicker addon. you should add the following to your widget call (along side 'model','attribute', etc)
'options'=>array(
'minDateTime'=>'<start dateTime here>',
'onSelect'=>'<JS function to run>'
)
The function you run on the "onSelect" event should dynamically set the minDateTime for the second dateTime input field, for ex:
function (selectedDateTime){
<EndDatePickerElement>.datetimepicker('option', 'minDateTime', <start dateTime here using selectedDateTime> );
}
There are more examples on the link provided earlier if you need to make it even more precise (like say if you wanted the starting date to be pushed back by the amount of time the user was on the page rather than it being set when the page was loaded. etc...)