Coding

Sergey Nuzhdin

1 minute read

There are lots of posts about magic behaviour of VK API. But yeasterday I faced another one. I have simple button on my site to share page on VK using Wall.post of OpenAPI, and yesterday I found out that it stopped working. After debuging I found error in API response: Permission to perform this action is denied for non-standalone applications: you should request token using blank.html page. The magical thing was that this error appears only on one type of pages, while on another everything was fine.

Sergey Nuzhdin

1 minute read

Short sqlalchemy query to get highcharts ready data from database from datetime field. select count(1), extract(epoch from date_trunc(‘hour’, created_at)) from bid group by extract(epoch from date_trunc(‘hour’, created_at)); db.session .query( extract(‘epoch’, func.DATE(Bid.created_at)).label(‘dt’), func.count() ) .filter(Bid.ownership == o) .filter(Bid.created_at > days_to_count ) .group_by(‘dt’) .order_by(‘dt’) )

Sergey Nuzhdin

3 minute read

For one of my projects I needed to post messages to Facebook Fan Page. After initial search I found out that Facebook has never-expiring token specially for this. It looks like trivial task and I was really surprised when I didn’t find any one-page step-by-step manual to get it. I decided to write all steps from the beginning, not only part about gettting never-expiring token.