Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
yandex-metrika
Advanced tools
Readme
Библиотека для API Яндекс.Метрики Для работы с данной библиотекой вам необходимо иметь OAuth-токен приложения Яндекс.Метрики. Для того, чтобы создать приложение:
const YMetrikaRequest = require( 'yandex-metrika' ),
oauth_token = 'OAuth токен',
counterId = 3123123, // id счётчика
api = new YMetrikaRequest( oauth_token );
/*
получить информацию о счтчике по id
GET /management/v1/counter/{counterId}
*/
api.get( `/management/v1/counter/${counterId}` )
.then( data => {
console.log( data );
});
// аналогично
api.request( `/management/v1/counter/${counterId}`, 'GET' )
.then( data => {
console.log( data );
});
/*
Создать новую цель
POST https://api-metrika.yandex.ru/management/v1/counter/{counterId}/goals
*/
api.post( `https://api-metrika.yandex.ru/management/v1/counter/${counterId}/goals`, {
name: 'Пробыл на сайте N минут',
type: 'action',
conditions: [
{
type: "exact",
url: "goal_slug"
}
]
})
.then( data => {
console.log( data );
});
/**
* Формирует GET, POST, PUT, DELETE запросы соответственно
* @param {String} url Адрес запроса на сервере, начиная с /
* @param {Object} data Данные для запроса (не включая token)
* @param {Object} headers Заголовки запроса
* @return {Promise} Обещание ответа
*/
api.get( url, data = {}, headers = {})
api.post( url, data = {}, headers = {})
api.put( url, data = {}, headers = {})
api.delete( url, data = {}, headers = {})
// формирует свободный запрос
api.request( url, method = 'GET', data = {}, headers = {})
Сделать тесты
FAQs
Библиотека для работы с API Яндекс.Метрики
The npm package yandex-metrika receives a total of 14 weekly downloads. As such, yandex-metrika popularity was classified as not popular.
We found that yandex-metrika demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.