package test;
import java.io.FileWriter;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class MAin {
public static void main(String[] args) {
String key = "7075966f7075966f7075966f577018909e770757075966f2dfd2579655817dfd28d3bfd";
String Vers = "5.103";
String url = "https://api.vk.com/method/photos.search?user_ids=210700286&fields=bdate&lat=55.879960&long=38.227373&count=1"
+ "&access_token=" + key+"&v="+Vers;
try {
URL obj = new URL(url);
HttpURLConnection connection = (HttpURLConnection) obj.openConnection();
connection.setRequestMethod("GET");
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
// System.out.println(response.toString());
try (FileWriter file = new FileWriter("./response-vk.json")) {
file.write(response.toString());
}
}catch(Exception e){}
}
}
import { VK } from 'vk-io';
const MY_GROUP_ID = 123456;
const vk = new VK({
// ...
pollingGroupId: MY_GROUP_ID
});
vk.updates.on('chat_invite_user', async (context, next) => {
const { eventMemberId } = context;
if (eventMemberId === -MY_GROUP_ID) {
console.log('It\'s invited my group!');
// ...
return;
}
console.log('Other invited', eventMemberId);
});
vk.updates.startPolling().catch(console.error);
query {
users(first: 10, order: "id") {
totalCount,
edges {
cursor,
node {
id,
name,
lastAt,
avatar {
original,
preview
}
}
},
pageInfo {
startCursor,
endCursor,
hasNextPage,
hasPreviousPage
}
}
}