npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

use-blogger

v0.9.4

Published

query variable json api google blogger withoot token

Downloads

11

Readme

UseBlogger

This script retrieves variables from a Blogger post and organizes all photos and videos into separate groups. Additionally, it collects all values defined in the variables and returns all threads in JSON format.

This is a JavaScript ES6 module that can be used to fetch data from a Blogger blog's json API without Token.

Dependencies

There are no external dependencies needed for this module.

Installation

You can download the main.js file and use it in your project, or install it using npm:

npm install use-blogger --save

in deno land

import * as denoblogger from "https://deno.land/x/[email protected]/mod.js";

Usage

import UseBlogger from "use-blogger";

const variables = [
  { key: "price", type: "number", regex: "price*[:=]*(.*?)[;<]" },
  { key: "discount", type: "number" },
  { key: "quantityAvailable", type: "number", as: "qnt" },
  { key: "currentPrice", type: "number" },
  { key: "sizes", type: "array", asArray: "options" },
  {
    key: "colors", type: "array", asArray: "options"
  },
];

async function myJsonBlogger() {
  const blogId = "8277077996046083588";
  //or
  //const blogUrl = "https://<name-your-blogger>.blogspot.com/"

  const wb = new UseBlogger({ blogUrl, blogId });
  const res = await wb.load(variables);
  console.log(res.data);
  console.log("lngth=" + res?.data.length)
}

myJsonBlogger();

API

The UseBlogger class is the main class of this module and is responsible for making requests to the Blogger API.

Constructor

new UseBlogger(props): Creates a new instance of the UseBlogger class with the following properties:

  • props.blogId (optional): The ID of the blog to fetch data from.
  • props.blogUrl (optional): The URL of the blog to fetch data from.
  • props.isBrowser (optional): If true, the request is made in the browser environment. Default is - false.
  • props.save (optional): A callback function to save data from the response.
  • Methods
  • categories(_categories): Sets the categories to fetch data from. Takes an array of strings as input.
  • uncategories(_categories): Sets the categories to exclude from the fetched data. Takes an array of - strings as input.
  • labels(_categories): Alias for categories.
  • unlabels(_categories): Alias for uncategories.
  • post(postId): Sets the ID of the post to fetch.
  • search(text): Adds a search query to the request.
  • limit(n): Sets the maximum number of posts to fetch.
  • select(_select): Selects certain fields to include in the response.
  • unselect(_select): Excludes certain fields from the response.
  • skip(n): Sets the number of posts to skip.
  • orderby(value): Sets the field to order the response by.
  • callback(cb): Sets a callback function to execute after the data is fetched.
  • setData(data): Sets the data for the current instance.
  • getData(): Returns the data for the current instance.
  • published(dateMin, dateMax): Sets the range of published dates to include in the response.
  • updated(dateMin, dateMax): Sets the range of updated dates to include in the response.
  • load(variables): Makes a request to the Blogger API and returns the response. Takes an array of objects that define the data to be fetched.